Skip to content

Extract adm2 summaries to json#181

Merged
bpstewar merged 1 commit into
mainfrom
adm2_json
Apr 20, 2026
Merged

Extract adm2 summaries to json#181
bpstewar merged 1 commit into
mainfrom
adm2_json

Conversation

@Gabe-Levin
Copy link
Copy Markdown
Collaborator

@Gabe-Levin Gabe-Levin commented Mar 28, 2026

What I changed

Extracted hardcoded ADM2 dataset config from client.py into a standalone ddh_datasets.json — single source of truth that supports multiple resource links per topic for upcoming multi-year datasets.

  • New: ddh_datasets.json with description, metadata link, and datasets dict (year → resource ID)
  • Replaced get_adm2_dataset_info() with get_adm2_datasets() — richer DataFrame output
  • Added year parameter to get_adm2_summaries() (defaults to latest)
  • Updated pyproject.toml, README, and tests

How to test

cd space2stats_client
python -m pytest tests/test_client.py -v -k "adm2"
from space2stats_client import Space2StatsClient
client = Space2StatsClient()
print(client.get_adm2_datasets())
df = client.get_adm2_summaries("population", iso3_filter="AND")

Comment thread space2stats_client/tests/test_client.py Dismissed
@Gabe-Levin Gabe-Levin temporarily deployed to Space2Stats API Dev March 28, 2026 14:23 — with GitHub Actions Inactive
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 28, 2026

PR Deployment Details:
🚀 PR deployed to https://brb7wvjtqb.execute-api.us-east-1.amazonaws.com/

@bpstewar bpstewar self-requested a review April 1, 2026 11:57
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the get_adm2_summaries defintion, the dataset parameter has hard-coded options, which should pull from the ddh_datasets.json keys

Copy link
Copy Markdown
Collaborator

@bpstewar bpstewar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good, although we may need to make some updates after testing

@bpstewar bpstewar merged commit 979b481 into main Apr 20, 2026
6 checks passed
@bpstewar bpstewar had a problem deploying to Space2Stats API Dev April 20, 2026 18:12 — with GitHub Actions Failure
@bpstewar bpstewar temporarily deployed to Space2Stats API Dev April 20, 2026 18:15 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants