Metadata-Version: 2.4
Name: ukrdc-stats
Version: 2.9.0
Summary: A package to produce stats from the ukrdc database to be displayed on the dashboard
License: MIT
License-File: LICENSE
Author: Philip Main
Author-email: Philip.Main@renalregistry.nhs.uk
Requires-Python: >=3.12,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: SQLAlchemy (>=2.0.0,<3.0.0)
Requires-Dist: freezegun (>=1.2.2,<2.0.0)
Requires-Dist: pandas (>=2.2.2,<3.0.0)
Requires-Dist: psycopg[binary] (>=3.2.3,<4.0.0)
Requires-Dist: pydantic (>=1.10.1,<2.0.0)
Requires-Dist: setuptools (>=75.8.0,<76.0.0)
Requires-Dist: ukrdc-sqla (>=2.6.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.

