Skip to main content

SynthPopCan

CI Documentation Status PyPI License: MIT

SynthPopCan logo

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 is published at https://synthpopcan.readthedocs.io/. The source files live 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.
  • CHANGELOG.md: public release notes and completed release highlights.

Quick Start

Install the published package from PyPI:

python -m pip install synthpopcan

Then inspect the command line:

synthpopcan --help

For a one-off command without installing the tool into the current environment, use uvx:

uvx synthpopcan --help
uvx synthpopcan guide ipf

From a source checkout for development:

git clone https://github.com/dlq/synthpopcan.git
cd synthpopcan
uv sync
uv run synthpopcan --help

For installation details, see docs/installation.md.

Where To Start

Most readers 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/data.md, docs/statcan.md, docs/microdata.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 plans and implementation notes PLANS.md, CHANGELOG.md

Build the documentation locally with:

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

Developer Benchmarks

Benchmark fixtures are developer tooling, not normal user workflows:

uv run python scripts/benchmarks.py ipf
uv run python scripts/benchmarks.py small-area
uv run python scripts/benchmarks.py small-area --province-scale
uv run python scripts/benchmarks.py ipf-backends

Use --seed-records for smaller or larger IPF runs. The province-scale small-area timing check is opt-in because it depends on the machine. Optional SciPy CSR and Polars comparisons remain benchmark probes rather than runtime backends, and full-data tree-model smoke tests remain outside the default suite.

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.

Release assets are gzip-compressed to keep downloads small. The CLI handles decompression and stores a normal JSON model package in the local cache.

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, PLANS.md, and CONTRIBUTING.md.

Metadata

Release files for synthpopcan 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for synthpopcan 0.3.2
File Size Uploaded
synthpopcan-0.3.2.tar.gz 6.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for synthpopcan 0.3.2
File Interpreter ABI Platform
synthpopcan-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 MB

Release files / synthpopcan-0.3.2.tar.gz

Download URL synthpopcan-0.3.2.tar.gz
Size 6.9 MB
Tags Source
SHA-256 checksum
How to use checksums
cd29bf8840a9a174904569a9ebb42c610c2cb6c11a21558571c147a4ecb3a43d
BLAKE2b-256 checksum
How to use checksums
9f8834dd1e6fe56cc01158cca68d427468f903eb2c6445a5189caf8cd3698061
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.

Transparency log

Release files / synthpopcan-0.3.2-py3-none-any.whl

Download URL synthpopcan-0.3.2-py3-none-any.whl
Size 249.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ebdfe43221958d8276f38a10d80f40d1a9cfab3a7076539b47832ba616abed17
BLAKE2b-256 checksum
How to use checksums
44df85906c40857a7f87929a0f7347fa543edb8edee874a89558d2f2d8d3f918
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.

Transparency log

Release history Release notifications | RSS feed

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

This release

0.3.2 This release

2 release files

0.3.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page