epiplot
Plots for epidemiology and public health research, with good practice built in.
Status
Early development (alpha). Ready to try:
- Epidemic curves: cases over time.
- Rate maps: rates by region, for one period or as a timeline.
Survival curves are planned.
Install
pip install epiplot
For rate maps, which need GeoPandas, install the extra map libraries too:
pip install "epiplot[maps]"
Requires Python 3.13 or newer. Works in Google Colab, which already includes GeoPandas.
Epidemic curves
import pandas as pd
import epiplot
# One row per case (a "line list").
cases = pd.DataFrame(
{
"onset_date": ["2026-03-02", "2026-03-04", "2026-03-10", "2026-03-11", None],
"origin": ["Local", "Travel", "Local", "Local", "Travel"],
}
)
ax = epiplot.epicurve(cases, "onset_date", date_type="onset", group_col="origin")
ax.figure.savefig("epicurve.png")
For the counts behind the plot, as a table, use epiplot.count_cases().
Good practice built in:
- Says what the dates mean. Onset, report, specimen or diagnosis dates tell different stories, so epiplot labels the axis to match, and warns if the date type isn't given.
- Shows empty periods as zero, so gaps in an outbreak stay visible.
- Reports cases with missing dates under the plot, instead of silently leaving them out.
- Shades recent periods that may be incomplete because of reporting delays, if you give it a date.
- Uses colour-blind-safe colours, with missing groups in grey.
- Supports ISO weeks (starting Monday) and US CDC weeks (starting Sunday).
Rate maps
# regions: a GeoPandas table of region shapes, with an "area_code" column.
# data: one row per region, with "cases" and "population" columns.
ax = epiplot.rate_map(
regions, data, "area_code", cases_col="cases", population_col="population"
)
# One small map per period, all sharing one colour scale.
figure = epiplot.rate_map_timeline(
regions,
data_by_month,
"area_code",
"month",
cases_col="cases",
population_col="population",
)
For the rates behind the maps, with exact 95% confidence intervals, use
epiplot.calculate_rates(). Rates you have already calculated, such as
age-standardised rates, can be mapped with rate_col and rate_label.
Good practice built in:
- Maps rates, not raw counts, since counts mostly show where people live. Rates are clearly labelled as crude rates.
- Hides regions with fewer than 5 cases, whose rates are unreliable and could identify individuals.
- Shows "no data" differently from zero, so gaps in reporting aren't mistaken for no disease.
- Uses a single-colour scale starting at zero, with colour bands as an option.
- Timelines share one colour scale, so the same shade means the same rate in every period.
Fuller examples are in the
examples
folder.
License
BSD 3-Clause. See LICENSE.
Metadata
Release files for epiplot 0.3.0
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 | Actions |
|---|---|---|---|---|
| epiplot-0.3.0.tar.gz | 23.7 kB | With provenance | Details for epiplot-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| epiplot-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for epiplot-0.3.0-py3-none-any.whl |
Total release size: 41.7 kB
Release files / epiplot-0.3.0.tar.gz
| Download URL | epiplot-0.3.0.tar.gz |
|---|---|
| Size | 23.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e733ecfe5db139fe99bf9f525de14cf9cf5a4c0ed4ee3efc98363a45d5de4ff
|
|
BLAKE2b-256 checksum How to use checksums |
4236295b068d27a9e7148669f553950fb2e343de6a835cc822e03b93f4810b72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / epiplot-0.3.0-py3-none-any.whl
| Download URL | epiplot-0.3.0-py3-none-any.whl |
|---|---|
| Size | 18.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
14bd0148265c4af2a8f03e7b8cf9ccd5e841cee4b5ff7f415345a7c44acf3250
|
|
BLAKE2b-256 checksum How to use checksums |
fe5d892991d54b78ffbd0904c201854b9956c16fa8340566f11dbeda3971f180
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logSecurity for epiplot 0.3.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for epiplot-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logA 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.