Skip to content

Rebuild deterministic country data core - #1

Merged
DataTideHH merged 3 commits into
mainfrom
rebuild/deterministic-core
Jul 27, 2026
Merged

Rebuild deterministic country data core#1
DataTideHH merged 3 commits into
mainfrom
rebuild/deterministic-core

Conversation

@DataTideHH

Copy link
Copy Markdown
Owner

Summary

  • remove the Anthropic client, API-key configuration and generated country facts
  • introduce a Flask application factory, blueprints and stable JSON error responses
  • add an explicit World Bank ingestion client with timeout and source-shape validation
  • separate live source retrieval from deterministic fixture-based refreshes
  • persist normalized country metadata, population observations and ingestion runs in constrained SQLite tables
  • add versioned API endpoints for health, country lists, country details and population history
  • add a fixture-capable refresh-data Flask CLI command
  • add 20 unit, persistence, route and CLI tests
  • add required Python 3.12 CI jobs for Ubuntu and Windows
  • rewrite the README and data-quality documentation around deterministic data integration

Validation target

  • application and tests compile on Python 3.12
  • all tests pass without live network access
  • the Flask CLI builds a deterministic SQLite database from versioned fixtures on Ubuntu and Windows

Repository rename

After this change is merged, the repository should be renamed from flask-ai-country-api to flask-country-data-api so the public name matches the implementation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 831879c118

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread country_api/validation.py
Comment on lines +194 to +196
try:
value = int(value)
except (TypeError, ValueError) as exc:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject fractional population values before storing them

When the source supplies a JSON number with a fractional component, such as 123.9, int(value) silently normalizes it to 123 rather than raising SourceValidationError. This lets malformed source data pass the stated integer validation and stores a corrupted population value; verify that numeric inputs are integral before converting them.

Useful? React with 👍 / 👎.

@DataTideHH
DataTideHH merged commit 6d3e9d7 into main Jul 27, 2026
2 checks passed
@DataTideHH
DataTideHH deleted the rebuild/deterministic-core branch July 27, 2026 17:57
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.

1 participant