Skip to main content

dansk-register

A platform for epidemiological studies on the Danish national registers, and the study pipelines built on it.

The package contains no data. It is the code that reads a register delivery inside a secure research environment, builds cohorts and outcomes from it, and estimates and reports the results.

What is in it

Package Role
dansk_register The reusable platform: register catalog and I/O, the staged-pipeline runner, matching, estimation, disclosure control, figure styling
societal_costs Study II: societal costs of severe chronic disease in childhood
edu_labour_trajectories Study III: educational and labour-market trajectories from age 18

The dependency direction is one way and enforced by a test: the platform never imports a study, and studies never import each other. Code that turns out to be general is lifted into dansk_register rather than shared sideways.

Install

pip install dansk-register
pip install "dansk-register[figures]"   # adds matplotlib for figure rendering

The figures extra is optional on purpose. The estimators are written in polars and validated against R, so the pipeline itself carries no numeric stack; matplotlib brings numpy and is needed only to draw. Without it every result is still produced and the figure stage records that it could not render.

Commands

edu-labour --list-profiles                          # what each profile runs
edu-labour-preflight --raw-root PATH                # what a delivery contains
edu-labour --output-dir RUN --profile production \
    --raw-root PATH --allow-expensive-stages --resume
edu-labour-figures --bundle RUN/outputs/export --out figures

societal-costs --output-dir RUN --profile production

Add --dry-run to any edu-labour invocation to resolve the plan and settings without touching data.

Design notes

Stages talk through files. Every stage writes named artifacts into a run directory and reads its inputs from there, so any stage can be re-run alone against a previous run's outputs, and --resume can skip what is already done.

Estimators are written against polars. Aalen-Johansen, Fine-Gray, Cox and the multi-state occupancy are implemented directly rather than taken from a modelling library, and each is validated against reference values from R with those values checked into the tests. That keeps the numbers checkable line by line and avoids a dependency that may not install in an offline environment.

Disclosure control is part of the pipeline. Results leave the secure environment as a bundle of CSV tables with small cells suppressed and the estimates resting on them blanked. Figures are rendered from that bundle rather than from the raw artifacts, so a figure cannot show what the table beside it was not cleared to show.

Status

Research code, developed alongside the studies it implements. The public API is not stable.

Licence

MIT. See LICENSE.

Metadata

Release files for dansk-register 0.6.0

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

Built distribution (wheel)

Table of built distributions (wheels) for dansk-register 0.6.0
File Interpreter ABI Platform Actions
dansk_register-0.6.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for dansk_register-0.6.0-cp312-cp312-win_amd64.whl

Release files / dansk_register-0.6.0-cp312-cp312-win_amd64.whl

Download URL dansk_register-0.6.0-cp312-cp312-win_amd64.whl
Size 7.2 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
89a20e76b2b215d0e8c8e598ae911f675ec7e1923a8390775e0f553ff4caedb0
BLAKE2b-256 checksum
How to use checksums
9f3acaaeae9a753aa204a5ad73f086ea47152ce1a9f6c918a9e887ad1cf4a793
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for dansk-register 0.6.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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