Query live ABS datasets, return data + citations, optional tables/charts/reports.
FilePurposescripts/abs_cache.pyMetadata cache manager — refresh catalog, search all 1,200+ dataflows, generate structured metadatascripts/abs_search.pyNL → dataset mapper — curated lookup + fuzzy fallback + ambiguity detectionscripts/abs_query.pyQuery engine — fetches data, formats output, summary/report/describe modesscripts/test_presets.pyPreset validation — tests all presets against live API, pass/fail summarypresets.json20 validated preset queries for common indicatorsmetadata.overrides.jsonManual overrides for discontinued datasets and nicer labelsreferences/dataset-catalog.md~55 curated datasets with IDs, versions, notes (human reference)references/api-guide.mdABS API URL patterns, response structure, example queriesreferences/sdmx-patterns.mdDimension codes (REGION, TSEST, FREQ, MEASURE) per dataset
bash
# 1. Warm the cache (do once; auto-refreshes after 24h)
python3 scripts/abs_cache.py refresh
python3 scripts/abs_cache.py gen-metadata
# 2. Search for a dataset (with ambiguity hints)
python3 scripts/abs_search.py "unemployment rate"
# 3. List presets
python3 scripts/abs_query.py --list-presets
# 4. Describe a preset
python3 scripts/abs_query.py --describe-preset cpi-annual-change
# 5. Query latest
python3 scripts/abs_query.py --preset cpi-annual-change --latest --format table
# 6. Summary brief (latest + change context)
python3 scripts/abs_query.py --preset cpi-annual-change --summary latest
# 7. Macro snapshot
python3 scripts/abs_query.py --report macro-snapshot
# 8. Chart
python3 scripts/abs_query.py --preset gdp-chain-volume --start-period 2020-Q1 --chart
references/dataset-catalog.md for the dataflow ID and versionpython3 scripts/abs_search.py "<user query>" for fuzzy match + ambiguity hintspython3 scripts/abs_cache.py search "<term>" (searches all 1,200+ dataflows)Check presets.json — if a preset exists, use it directly
Read references/sdmx-patterns.md for common dimension codes
For an unfamiliar dataset, fetch its structure: bash
python3 scripts/abs_cache.py structure <ID> <VERSION>
bash
python3 scripts/abs_query.py <ID> [KEY] [--version V] [--start-period P] [--end-period P] [--latest] [--format text|csv|json|table] [--chart] [--out FILE]
--format table for markdown tables.matplotlib; gracefully falls back if not installed.--summary latest for quick briefs with change context.--report macro-snapshot for a full multi-indicator briefing.Common indicator queries are bundled in presets.json. All validated live March 2026.
bash
# List all available presets
python3 scripts/abs_query.py --list-presets
# Describe a preset (shows what it measures and when to use it)
python3 scripts/abs_query.py --describe-preset unemployment-rate
# Run a preset
python3 scripts/abs_query.py --preset cpi-annual-change --latest --format table
python3 scripts/abs_query.py --preset unemployment-rate --latest
python3 scripts/abs_query.py --preset gdp-annual-change --chart
python3 scripts/abs_query.py --preset wage-annual-change --start-period 2020-Q1
python3 scripts/abs_query.py --preset population-national --format csv
python3 scripts/abs_query.py --preset dwelling-prices-mean --format table
python3 scripts/abs_query.py --preset trade-balance --start-period 2024-01
python3 scripts/abs_query.py --preset household-spending-change --summary latest
Key presets: cpi-annual-change, unemployment-rate, participation-rate, employment-level,
underemployment-rate, labour-force-size, gdp-annual-change, wage-annual-change,
population-national, dwelling-prices-mean, trade-balance, goods-exports, goods-imports,
household-spending-change.
FlagOutput_(default)_Human-readable text with friendly labels + citation--format tableMarkdown table with friendly labels and rendered periods--format csvCSV with raw codes + citation comment--format jsonJSON with raw codes + *_label fields + TIME_PERIOD_rendered``--chartPNG chart with dataset title, subtitle, latest-point annotation--summary latestLatest value + previous + absolute/percentage-point deltas + textual summary--report macro-snapshotCompact multi-indicator macro briefing (7 key economic indicators)--citation-style analystAnalyst-style source footnote block--flat-viewAllDimensions format (wider; may be large)
All output modes now render periods in human-readable format:
2026-01 → January 20262025-Q4 → December quarter 20252025-Q1 → March quarter 2025March quarter 2024 to December quarter 2025This applies to table headers, text output, citations, chart labels, and summary/report output.
--format json returns both raw dimension codes and friendly *_label fields:
json
{
"TSEST": "20",
"TSEST_label": "Seasonally Adjusted",
"TIME_PERIOD": "2026-02",
"TIME_PERIOD_rendered": "February 2026",
"value": 4.277
}
Backward compatible — raw codes are preserved.
abs_search.py classifies ambiguity when multiple datasets match:
Prints clarifying questions to help the user or agent narrow the query.
CommandDescriptionabs_cache.py refreshFetch all dataflows from ABS, save to ~/.cache/abs-data-api/catalog.json``abs_cache.py gen-metadataGenerate metadata.generated.json from presets + catalog + overridesabs_cache.py statusShow cache age, dataflow count, structure count, metadata statusabs_cache.py search <term>Search across all cached dataflowsabs_cache.py structure <ID> [VER]Fetch and cache DSD for a specific dataflow
Runtime metadata priority: metadata.generated.json > catalog.json > dataset-catalog.md.
Override quirks (discontinued datasets, nicer labels) in metadata.overrides.json.
bash
python3 scripts/test_presets.py # test all presets
python3 scripts/test_presets.py --verbose # with timing
python3 scripts/test_presets.py --preset unemployment-rate # single
CPI beats CPI_M beats PPI.all — the API will return everything; then filter. If the response is large (>100 observations), the tool warns you.1.0.0 as last resort.--latest flag (uses lastNObservations=1).census-database skill; this skill handles ABS time-series only.HSI_M or BUSINESS_TURNOVER instead.RES_DWELL_ST for current dwelling prices.All responses include a citation:
Source: Australian Bureau of Statistics,
<Full Dataset Name>(Cat.<catalogue-number>; dataset<ID>; v<version>).<human-readable-period>. Retrieved via ABS Data API:<url>.
Example:
Source: Australian Bureau of Statistics, Consumer Price Index (Cat. 6401.0; dataset
CPI; v2.0.0). January 2026. Retrieved via ABS Data API:https://data.api.abs.gov.au/rest/data/ABS,CPI,2.0.0/.
gen-metadata command: Builds unified metadata from presets + live catalog + manual overridesbash
python3 scripts/abs_cache.py gen-metadata
bash
python3 scripts/abs_search.py "inflation" # May suggest CPI, CPI_M, PPI with clarifying Qs
--summary latest: Shows latest value + previous + absolute deltas + brief summary
Automatically detects rates/growth measures and uses percentage-point notation instead of misleading relative % changes
Ideal for quick briefings and executive summaries
bash
python3 scripts/abs_query.py --preset unemployment-rate --summary latest
# Output: Current: 4.3% | Previous: 4.0% (Feb) | Change: +0.3pp | [Brief context]
--report macro-snapshot: Single-command economic briefing covering 7 key indicatorsbash
python3 scripts/abs_query.py --report macro-snapshot
Smart detection: Automatically recognizes rates and growth measures via keyword matching
Applies percentage-point notation to avoid confusion with relative % changes
Examples:
Applies to all output modes: text, table, JSON, summary
The query engine appends this automatically. Do not strip it from tool output.
New Features:
gen-metadata command) — builds unified metadata from presets + catalog + overrides with auto-refresh--summary latest) — shows latest + previous + absolute deltas + brief summary--report macro-snapshot) — single-command economic briefing covering 7 key indicatorsintent_group and ambiguity_tags for smarter disambiguationImprovements:
Affected Scripts:
abs_cache.py — added gen-metadata command and generate_metadata() functionabs_search.py — added ambiguity detection, intent grouping, and clarifying questionsabs_query.py — added --summary latest, --report macro-snapshot, percentage-point delta detectionmetadata.overrides.json — new file for manual dataset overrides