Metadata-Version: 2.1
Name: ukrdc-stats
Version: 0.3.0
Summary: A package to produce stats from the ukrdc database to be displayed on the dashboard
Home-page: https://github.com/renalreg/dashboard-stats
License: MIT
Author: Philip Main
Author-email: Philip.Main@renalregistry.nhs.uk
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: SQLAlchemy (>=1.4.40,<2.0.0)
Requires-Dist: freezegun (>=1.2.2,<2.0.0)
Requires-Dist: pandas (>=1.4.3,<2.0.0)
Requires-Dist: psycopg2-binary (>=2.9.3,<3.0.0)
Requires-Dist: pydantic (>=1.10.1,<2.0.0)
Requires-Dist: ukrdc-sqla (>=2.0.0,<3.0.0)
Project-URL: Repository, https://github.com/renalreg/dashboard-stats
Description-Content-Type: text/markdown

# Dashboard Statistics Library

Library for generating statistics for the UKRDC dashboard

## Installation

`pip install ukrdc-stats`

## Basic usage

Statistics calculations require an SQLAlchemy session with a connection to the UKRDC3 database.
In this example, we use `ukrdc3_session`, and calculate for the unit code "TEST_UNIT".

```python
from ukrdc_stats import DemographicStatsCalculator

demographics = DemographicStatsCalculator(ukrdc3, "TEST_UNIT").extract_stats()
```

Each calculator returns multiple stats from the same cohort, and each of those includes basic metadata required for rendering and plotting the data.

