Skip to main content

Canadian synthetic population tooling for StatCan margin tables and Census microdata.

Project description

SynthPopCan

SynthPopCan is an early-stage project for building Canadian synthetic population tooling.

SynthPopCan is an independent research-software project. It is not affiliated with, endorsed by, or sponsored by Statistics Canada or the Government of Canada.

Near-term goals:

  1. Provide a Python library and CLI that can create synthetic populations through IPF from Statistics Canada margin/control tables.
  2. Build census microdata workflows for household- and person-level synthetic populations using a tree-based synthetic population generator plus calibration. The local 2016 Census material is the first available microdata source, but the tooling should be census-year agnostic.
  3. Maintain a local web app for configuring runs, inspecting controls, generating from prepared models, validating outputs, and downloading results.

Broader SynthEco-style enrichment with cohort, environmental, school, healthcare, and food-access layers is intentionally deferred until the base population synthesis workflow is stable.

Detailed documentation lives under docs/. Start with docs/index.rst for task-based navigation to the web app, IPF from StatCan margin tables, generated-from-model workflows, the beginner Python API, and advanced microdata/model-training material.

Project planning and research notes are tracked separately:

  • PLANS.md: current roadmap, open work, sequencing, and design decisions.
  • NOTES.md: research synthesis from local materials and external literature.
  • docs/status.md: completed implementation status and benchmark notes.

Quick Start

SynthPopCan is not yet published on PyPI. From a source checkout, install the development environment with:

uv sync

Run the local web app:

uv run synthpopcan serve

Or inspect the command line:

uv run synthpopcan --help

For installation details, see docs/installation.md.

Where To Start

Most users should start in the Sphinx documentation rather than in this README:

Task Documentation
Use the local browser app docs/web-app.md
Generate with IPF from margin/control tables docs/ipf.md, docs/controls.md, docs/statcan.md
Use the beginner Python API docs/library-getting-started.md
Work with local data layout and data doctor docs/data.md
Inspect source files safely docs/sources.md
Work with census microdata adapters docs/microdata.md
Train, audit, package, or use tree models docs/tree.md
Validate generated outputs docs/validate.md
Check current implementation status docs/status.md

Build the documentation locally with:

uv run sphinx-build -W -b html docs docs/_build/html

Developer Benchmarks

IPF benchmark fixtures are available as developer tooling, not as a normal user workflow:

uv run python scripts/benchmark_ipf.py

Use --seed-records for smaller or larger local runs while checking performance changes. Optional full-data tree-model smoke tests are documented as status and planning evidence rather than as default test-suite requirements.

Data Policy

Large, raw, private, or access-controlled data are not tracked in git.

  • data/raw/ is a local ignored cache for central raw inputs, including public Census Profile and WDS downloads.
  • data/private/ is a local ignored cache for access-controlled or sensitive later-use datasets.
  • references/ is a local ignored cache for copied papers, proposals, and legacy code references.

Public geography, school, healthcare, road, and environmental layers should generally be fetched from authoritative public sources such as Statistics Canada, open.canada.ca, donneesquebec.ca, and municipal/provincial open-data portals rather than stored in this repository.

Local-only manifests may exist inside ignored data directories to document what is present on a development machine.

Model Packages

Reviewed model packages may be distributed with the project when they are explicitly intended as public research artifacts. The installed package should stay small: only the tiny demo model is bundled. Larger published models are downloaded on demand with synthpopcan models fetch MODEL_ID.

Bundled model packages are not raw Census microdata. They should still be treated as derived research artifacts with provenance, disclosure-risk checks, and limitations. A model package being marked as a publishable candidate means it passed the project's current checks; it is not a claim of official approval, legal privacy certification, or fitness for every research use.

Before publishing a new model package, review docs/data.md, docs/tree.md, and CONTRIBUTING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synthpopcan-0.1.0.tar.gz (6.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

synthpopcan-0.1.0-py3-none-any.whl (203.6 kB view details)

Uploaded Python 3

File details

Details for the file synthpopcan-0.1.0.tar.gz.

File metadata

  • Download URL: synthpopcan-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for synthpopcan-0.1.0.tar.gz
Algorithm Hash digest
SHA256 96a767891de05ea3ad1683bc81779ce8c38b6ea76a108992467272ff423ab2dd
MD5 bdb35c8786e1ab5c729cc7bbdf8c6a9f
BLAKE2b-256 358365a44bae0fc5185578f0c4dff689a8c03aa49e358fa67d6cc1df5be40ea0

See more details on using hashes here.

Provenance

The following attestation bundles were made for synthpopcan-0.1.0.tar.gz:

Publisher: publish.yml on dlq/synthpopcan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file synthpopcan-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: synthpopcan-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 203.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for synthpopcan-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 83699f2ee8cb9ae408a9d4e8cb738bbb73ddebabbd12c4137990322ed377c51e
MD5 7af0da476b74f9bf27a168c451568da6
BLAKE2b-256 6cf8fdc3ced1c4ca32624696bd2dfb6bc8479ec1eb32c4b85d9092dcba7dbe24

See more details on using hashes here.

Provenance

The following attestation bundles were made for synthpopcan-0.1.0-py3-none-any.whl:

Publisher: publish.yml on dlq/synthpopcan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page