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 new SQL aggregate functions for use within Datasette:
statistics_mean()for calculating the meanstatistics_geometric_mean()for calculating the geometric mean (requires Python 3.8+)statistics_median()for calculating the medianstatistics_median_low()for calculating the low medianstatistics_median_high()for calculating the high medianstatistics_mode()for calculating the modestatistics_stdev()for calculating the sample standard deviationstatistics_pstdev()for calculating the population standard deviationstatistics_variance()for calculating the sample variancestatistics_pvariance()for calculating the population variance
These all 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
Metadata
Release files for datasette-statistics 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| datasette-statistics-0.2.1.tar.gz | 3.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| datasette_statistics-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.0 kB
Release files / datasette-statistics-0.2.1.tar.gz
| Download URL | datasette-statistics-0.2.1.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4bc1f8ccbd0ff106527d3435dc1bf9daba7f952ba4022cfe21cdf4f8e7f010b7
|
|
BLAKE2b-256 checksum How to use checksums |
f817f9ca64f1b86305c35226c71eb43b373143f7a8020c2bb72384cea16f4760
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / datasette_statistics-0.2.1-py3-none-any.whl
| Download URL | datasette_statistics-0.2.1-py3-none-any.whl |
|---|---|
| Size | 2.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dce7da349cacc8bd9d744595cc627cd960a3947f7d28831a502c6941d967e5ca
|
|
BLAKE2b-256 checksum How to use checksums |
010d34986a50640d397e0951c8b49f89d81296665d487ecc1a4040280120cb41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for datasette-statistics 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.