This release is a pre-release and may not be stable for production use.
datasette-charts-pie
Pie, donut, sunburst and rose charts for datasette-charts.
Installation
Install this plugin in the same environment as Datasette and datasette-charts.
datasette install datasette-charts-pie
Chart types
| Type | Shows | Suggested when |
|---|---|---|
pie |
Each value of a category as a share of the whole: the top slices plus "Other" | A category with 3 to 6 values, none of them too dominant or too rare. Always ranked below the bar chart of the same column |
donut |
The same, with the total in the hole | Not suggested |
sunburst |
Two categories as two rings: each inner slice broken down by a second column | Not suggested |
rose |
A count or an aggregate around a cycle: month of the year, day of the week or hour of the day | A date column that spans at least 2 years (months), 8 weeks (weekdays) or 7 days (hours, not for dates with no time of day) |
All of these chart types can be constructed by hand in the chart builder. Pie and Rose charts will be suggested if the data matches the above criteria.
pie and donut
Live demo: PyPI packages by license, in Datasette Lite.
Live demo: total PyPI downloads by package.
{
"v": 1,
"type": "donut",
"encoding": {
"x": {"column": "primary_fuel", "limit": 6, "other": true},
"y": {"column": "capacity_mw", "aggregate": "sum"}
},
"options": {"labels": "percent", "sweep": "full", "center": "total"}
}
x: the slices, a category.limitdefaults to 6. At most 8 slices are drawn, as core has eight series colors: a largerlimitis treated as 8. The rest are always summed into an "Other" slice, andother: falseis ignored, since leaving out the small slices would make the rest look like the whole.sort: slices run clockwise from 12 o'clock, largest first, with "Other" last.keyor-keyorders them by value instead, for categories with a natural order.y: optional, a count of rows (the default) orsumof a column. Averages and the other aggregates are not shares of anything, so they are not offered.labels:percent(the default),valueornone. A label goes inside its slice when it fits, outside with a short leader when the slice is too thin but at least 4% of the whole, and nowhere below that. The legend always has every name, value and share.sweep:full(the default) orhalf, for a half circle from 9 o'clock to 3 o'clock.center, on a donut only:total(the default) writes the sum of the slices in the hole, andnoneleaves it empty.- A slice whose value is zero or null is left out. If any group's sum is below zero there is no whole to take shares of, and the chart says so.
sunburst
Live demo: GitHub releases by author, then repository.
{
"v": 1,
"type": "sunburst",
"encoding": {
"x": {"column": "country", "limit": 6},
"series": {"column": "city", "limit": 5},
"y": {"aggregate": "count"}
}
}
x: the inner ring, a category.limitdefaults to 6, at most 8, with the rest in one "Other" slice that is not broken down.series: the outer ring, a different column. Its values are ranked within each inner slice, so each country gets its own largest cities.limitdefaults to 5 for each inner slice, at most 8, with the rest of each in a pale "Other".y: optional, a count of rows (the default) orsumof a column. Cells whose sum is zero or below are left out, so a sum of a column with negative values is not supported.- The legend lists the inner ring. The outer ring is named by labels where the arcs are long enough, and by tooltips.
- It is best for columns that really nest, such as city inside country. For two columns that cut across each other, a stacked bar chart is easier to read.
rose
Live demo: GitHub releases by hour of the day, in UTC.
{
"v": 1,
"type": "rose",
"encoding": {
"x": {"column": "started_at"},
"y": {"aggregate": "count"}
},
"options": {"cycle": "month"}
}
x: a date or time column: ISO dates or datetimes, or Unix seconds or milliseconds, as the column's profile says. Times are read as UTC, as in core.cycle:month(the default),weekday(Monday first) orhour. A column of dates has no hours, and a column of years has none of these, so those are errors.y: optional, a count of rows (the default) or any aggregate of a column:sum,avg,min,maxorcount_distinct. A rose shows magnitude, not shares, so an average for each month is fine. A chart with any value below zero shows a message instead.- Every step of the cycle gets a wedge of the same angle, so a month with no rows is an empty wedge. A wedge's radius grows with the square root of its value, so the area it fills is in proportion to it.
Development
This plugin is developed against a checkout of datasette-charts next to it, set in pyproject.toml:
[tool.uv.sources]
datasette-charts = { path = "../datasette-charts", editable = true }
To run the tests:
cd datasette-charts-pie
uv run pytest
The tests of the drawing geometry in static/arcs.js run in node, and are skipped if node is not installed.
To try the charts on made-up data:
uv run python demo/build_demo.py
uv run datasette demo/demo.db
The screenshots/ folder has the screenshots in this README, taken from the demo database.
Metadata
Release files for datasette-charts-pie 0.1a0
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 |
|---|---|---|---|---|
| datasette_charts_pie-0.1a0.tar.gz | 44.0 kB | With provenance | Details for datasette_charts_pie-0.1a0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datasette_charts_pie-0.1a0-py3-none-any.whl | Python 3 | none | any | Details for datasette_charts_pie-0.1a0-py3-none-any.whl |
Total release size: 82.2 kB
Release files / datasette_charts_pie-0.1a0.tar.gz
| Download URL | datasette_charts_pie-0.1a0.tar.gz |
|---|---|
| Size | 44.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eec8e9beb185da3200f28daa1e7689829c70163db7d29013906e807cc4d42df0
|
|
BLAKE2b-256 checksum How to use checksums |
e705b56ef006522bf70f74670192ac6380b7db037dc03ac9a2150af486f693d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 28, 2026.
Transparency logRelease files / datasette_charts_pie-0.1a0-py3-none-any.whl
| Download URL | datasette_charts_pie-0.1a0-py3-none-any.whl |
|---|---|
| Size | 38.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bb3ba3fd2f9449dea3cf20b5d09ca59df974ca0e39f0a06dc4d90f5443cbc7a1
|
|
BLAKE2b-256 checksum How to use checksums |
c1d417e15af232577d59eb6ee37b22dc6a4e34b36b8c1021e7bd492514908f9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 28, 2026.
Transparency logSecurity for datasette-charts-pie 0.1a0
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 datasette_charts_pie-0.1a0.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 Nov 28, 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.