pyivt
About the Project
Read Statistics Canada Beyond 20/20 (.ivt) files, inspect bilingual metadata, and export to Apache Arrow or Parquet.
Getting Started
Prerequisites
Python 3.10+ and PyArrow 14+. Installation brings in PyArrow automatically.
Installation
pip install pyivt
With uv, run uv add pyivt.
Usage
Open a table
import pyivt
ivt = pyivt.open("data.ivt")
print(ivt.metadata.title.en or ivt.metadata.title.fr)
Use an extracted IVT version 4 file. For a download, pass the complete IVT bytes to pyivt.open().
Inspect dimensions
for dimension in ivt.metadata.dimensions:
print(dimension.slug, dimension.name.en, dimension.items)
Use the slugs as Arrow column names and selection keys.
Export to Parquet
import pyarrow.parquet as pq
table = ivt.to_arrow()
pq.write_table(table, "data.parquet")
for slug, lookup in ivt.members().items():
pq.write_table(lookup, f"data.{slug}.parquet")
Each lookup has one row per member code. Join the fact table's dimension column
to the lookup's code column to attach labels or other attributes.
Select a subset
slug = ivt.metadata.dimensions[0].slug
code = ivt.members()[slug]["code"][0].as_py()
selection = {slug: [code]}
subset = ivt.to_arrow(**selection)
subset_members = ivt.members(**selection)
Pass the same dimension keywords to both methods so their code types and subsets match. An integer fixes a dimension at one member and drops its column. A list retains the column and filters its rows. Omitted dimensions retain all members and their columns. An empty list selects zero rows.
Generate Python types for a table
pyivt codegen data.ivt --output dimensions.py
The generated module contains one IntEnum per dimension and a Dimensions
typed dictionary for selection keywords. Use enum members as codes when calling
to_arrow() or members(). Add --language fr to use French labels for enum names.
API Reference
Opening and exporting
open()returns anIvt. It accepts a path, IVT bytes, abytearray, an object with__bytes__, or a binary file object.to_arrow()returns rows in file order with unsigned member codes and a nullablefloat64column namedvalue.members()returns a dictionary of PyArrow tables keyed by dimension slug, without decoding cells.pyivt.__version__gives the package version.
Member lookup tables
codecontains native integer codes in file order. Axes without a nativeCodefield use one-based positions. Invalid or duplicate native codes raiseValueError.labelis a nullable string in English by default. Usemembers(language="fr")for French labels. Time-axis labels use ISO dates.- Native attributes use Arrow strings, integers, floats, or
date32dates. Text fields retain their original values. Native fields that collide with lookup column names, such asCode, receive anative_prefix. Remaining name collisions receive numeric suffixes. - Both the fact table and lookup schemas carry
pyivt.table_idto identify the source table.
Metadata
meta = ivt.metadata
print(meta.title.en, meta.title["fr"])
print([(dimension.slug, dimension.items) for dimension in meta.dimensions])
Read-only IvtMetadata is available without decoding cells.
title,author,category,keywords, andnotesuseLocalizedText.- Table fields include
product_id,universe,number_of_datapoints,version,signature, andread_only. - Time fields are
frequency,start_date, andend_date. Known frequencies are"monthly","quarterly","semi_annual", and"annual". - Both
LocalizedTextandLocalizedLabelsacceptenandfr. Missing translations areNone.
Dimensions and legends
- Each
Dimensioninmeta.dimensionshasslug,name,description,notes,items, andmembers. Itstypeis"geographic","normal", or"time_series". meta.geographiesreturnsGeographieswithmember_id,geo_label,geo_name,geo_uid,dqf_code, andtnr_short_form.- Each
Footnoteinmeta.footnoteshassymbol,number, anddescription. - Each
MissingValueinmeta.missing_valueshassymbol,description, andcode.
License
Acknowledgments
Metadata
Release files for pyivt 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyivt-0.0.8.tar.gz | 646.3 kB | With provenance | Details for pyivt-0.0.8.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| pyivt-0.0.8-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for pyivt-0.0.8-cp310-abi3-win_amd64.whl |
| pyivt-0.0.8-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details for pyivt-0.0.8-cp310-abi3-manylinux_2_28_x86_64.whl |
| pyivt-0.0.8-cp310-abi3-manylinux_2_28_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ ARM64 | Details for pyivt-0.0.8-cp310-abi3-manylinux_2_28_aarch64.whl |
| pyivt-0.0.8-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for pyivt-0.0.8-cp310-abi3-macosx_11_0_arm64.whl |
| pyivt-0.0.8-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details for pyivt-0.0.8-cp310-abi3-macosx_10_12_x86_64.whl |
Total release size: 10.7 MB
Release files / pyivt-0.0.8.tar.gz
| Download URL | pyivt-0.0.8.tar.gz |
|---|---|
| Size | 646.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
31ff5bc503ec93bef7a558d8ca57c762a94180d3c4cbee46046ddf8ba05359aa
|
|
BLAKE2b-256 checksum How to use checksums |
ed2cbf9b56245a586e053ecdfb56a2da26f66c2ff444f0103a9d4962b67fa1ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 5, 2026.
Transparency logRelease files / pyivt-0.0.8-cp310-abi3-win_amd64.whl
| Download URL | pyivt-0.0.8-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6f28606b028f53bd9e3d430ffa48fe246c8b15ecf5189109ba9b5d406047e4f8
|
|
BLAKE2b-256 checksum How to use checksums |
491e14721b8d974b58013a0e0eaed835c43b5d2ad578217a808eed7f03c35eaf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 5, 2026.
Transparency logRelease files / pyivt-0.0.8-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | pyivt-0.0.8-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
d891ca89b710b7072a746eee0d647f6c1d7560bcbb7efaa61eb3ef1de8165885
|
|
BLAKE2b-256 checksum How to use checksums |
ea4d4fc5d3fb757b1ca36003f0cba9ddcb6ab55044c60d0495c6bee8b4811552
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 5, 2026.
Transparency logRelease files / pyivt-0.0.8-cp310-abi3-manylinux_2_28_aarch64.whl
| Download URL | pyivt-0.0.8-cp310-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
9eb79031ac073551b8c8a1faf94e7d3f3bd407eeb39aaa26afc962e997415fd1
|
|
BLAKE2b-256 checksum How to use checksums |
f2200f330454164b1886340a7f5d7aebe3c1da87c67a00639fdca8fe61d1f7a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 5, 2026.
Transparency logRelease files / pyivt-0.0.8-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | pyivt-0.0.8-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d2efffb766b0af3fe1f9b534a9f96267dd946a8dfefee804c334109b21019f04
|
|
BLAKE2b-256 checksum How to use checksums |
2a3f958bd8cb6b70fab7e778b426408d53a4fcb278734ceff4673c7c63f22756
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 5, 2026.
Transparency logRelease files / pyivt-0.0.8-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | pyivt-0.0.8-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
428c1984a36b1a125ae73ac07e0d641dc2d2b699cf81c8020eba4e43e4c5054d
|
|
BLAKE2b-256 checksum How to use checksums |
d65fb81fc642f6db0b6cbf8c43e038454465ff586be034e82cdbb7561405dd26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 5, 2026.
Transparency logSecurity for pyivt 0.0.8
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.
Full provenance
All 6 files in this release have been uploaded with provenance metadata.
Attestation for pyivt-0.0.8.tar.gz
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 Nov 5, 2026.
Transparency logA 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.