SQL statistics functions for Datasette
Project description
datasette-statistics
SQL statistics functions for Datasette
Installation
Install this plugin in the same environment as Datasette.
$ datasette install datasette-statistics
Usage
This plugin adds three new SQL aggregate functions for use within Datasette:
statistics_mean()
for calculating the meanstatistics_median()
for calculating the medianstatistics_mode()
for calculating the mode
All three use the implementations from the Python statistics library.
Use them like this:
select statistics_mean(numeric_column) from mytable
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-statistics
python3 -mvenv venv
source venv/bin/activate
Or if you are using pipenv
:
pipenv shell
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for datasette_statistics-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af7cb86e4bcc2bf55c9ad481dc098f276fc681ce26be48e56aea3928a95bf171 |
|
MD5 | c1bd0caa78b2186b97f0820e6a665f55 |
|
BLAKE2b-256 | 0ff795f37eea89d34aedfaf4319686c29ee22aa3a3821f2f6cf249e20ba29e8b |