StatsMapped Public Data
Public statistics for Ireland and the UK: housing, crime, health, economy, welfare, with caveats.
- 0.3.2
- Version
- remote + pypi
- Transport
- 4
- Tools
Security review
Review passedReviewed 29m ago.
- tools: 4 tools scanned
- metadata: scanned
- packages: 1 checked
No findings.
Tools (4)
query_data
Three modes, depending on which of `area_id`/`dataset` are given -- consolidates what were three separate tools (list_datasets, list_area_datasets, get_dataset_for_area) behind one, since they are all really "how do I get data" at different levels of specificity: 1. Neither `area_id` nor `dataset`: lists every dataset (stat) StatsMapped tracks for one country ('ireland' or 'united-kingdom'), with its key, human label, and which geography levels it can be shown at. Ireland and the UK track genuinely different datasets -- call this first for the right country before assuming a stat_key exists there, to find the right `stat_key` for `compare`'s ranking mode. 2. `area_id` given, `dataset` omitted: lists every dataset available for that one area (e.g. "county:kerry" for Ireland, "uk:lad:e09000033" for the UK), with its latest figure, year-on-year change, and caveat labels only (not full caveat text -- use mode 3 fo
list_areas
List every geography at one boundary level, for one country ('ireland' or 'united-kingdom'). `level` defaults to "county" (Ireland's 26 counties); the UK's own primary level is "lad" (local authority districts), not "county". Other levels exist per country (e.g. Ireland's "local_authority", "garda_division") -- see a dataset's own `compatible_levels` from `query_data` for which levels a given stat is actually published at. Returns each area's `id` (used by `query_data`'s area-scoped modes, always paired with the SAME `country`) and `name`.
compare
Four modes, depending on which arguments are given -- consolidates what were four separate tools (rank_areas, list_comparisons, get_comparison, check_comparability) behind one, since they are all really "how does this stat compare" at different scopes. Exactly one mode's arguments should be given; mixing arguments from different modes (e.g. both `stat_key` and `pair_key`, or only one of `stat_key_a`/`stat_key_b`) raises an error rather than silently guessing which mode was meant. 1. `stat_key` alone (no `pair_key`, no `stat_key_a`/`stat_key_b`): ranks every area at one geography level by its latest figure for that stat, for one country -- e.g. "which counties have the highest median sale price" (country="ireland"). `stat_key` comes from `query_data`'s dataset-listing mode, for the SAME country. `level` omitted uses this ranking's own default level; pass one of that dataset's own `compatible_levels` for a different o
explain_metric
Definition, methodology and standing caveats for ONE stat ('ireland' or 'united-kingdom') -- never a current figure. Call this when the question is about what a metric MEANS or how it's measured ("how is the claimant count defined", "is this a mean or a median"), not about a specific area's value -- `query_data`/`compare` already answer that. `stat_key` comes from `query_data(country=...)` for the SAME country.