pyivt 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyivt-0.0.1/.github/workflows/ci.yml +40 -0
- pyivt-0.0.1/.github/workflows/release.yml +127 -0
- pyivt-0.0.1/.gitignore +21 -0
- pyivt-0.0.1/.vscode/extensions.json +7 -0
- pyivt-0.0.1/.vscode/settings.json +21 -0
- pyivt-0.0.1/CHANGELOG.md +28 -0
- pyivt-0.0.1/Cargo.lock +981 -0
- pyivt-0.0.1/Cargo.toml +16 -0
- pyivt-0.0.1/LICENSE +21 -0
- pyivt-0.0.1/PKG-INFO +163 -0
- pyivt-0.0.1/README.md +131 -0
- pyivt-0.0.1/pyproject.toml +55 -0
- pyivt-0.0.1/python/pyivt/__init__.py +29 -0
- pyivt-0.0.1/python/pyivt/__init__.pyi +29 -0
- pyivt-0.0.1/python/pyivt/_native.pyi +120 -0
- pyivt-0.0.1/python/pyivt/py.typed +0 -0
- pyivt-0.0.1/src/arrow_export.rs +80 -0
- pyivt-0.0.1/src/bytes.rs +138 -0
- pyivt-0.0.1/src/decode.rs +504 -0
- pyivt-0.0.1/src/descriptor.rs +452 -0
- pyivt-0.0.1/src/header.rs +227 -0
- pyivt-0.0.1/src/lib.rs +16 -0
- pyivt-0.0.1/src/metadata.rs +1543 -0
- pyivt-0.0.1/src/py/mod.rs +21 -0
- pyivt-0.0.1/src/py/types.rs +545 -0
- pyivt-0.0.1/src/tidy.rs +185 -0
- pyivt-0.0.1/tests/conftest.py +66 -0
- pyivt-0.0.1/tests/fixtures/demo/expected/oecd.json +84 -0
- pyivt-0.0.1/tests/fixtures/demo/expected/people.json +96 -0
- pyivt-0.0.1/tests/fixtures/demo/expected/products.json +96 -0
- pyivt-0.0.1/tests/fixtures/demo/expected/sample.json +104 -0
- pyivt-0.0.1/tests/fixtures/demo/manifest.json +18 -0
- pyivt-0.0.1/tests/fixtures/statcan/expected/98100030.json +213 -0
- pyivt-0.0.1/tests/fixtures/statcan/expected/98100033.json +197 -0
- pyivt-0.0.1/tests/fixtures/statcan/expected/98100034.json +137 -0
- pyivt-0.0.1/tests/fixtures/statcan/expected/98100035.json +141 -0
- pyivt-0.0.1/tests/fixtures/statcan/expected/98100036.json +137 -0
- pyivt-0.0.1/tests/fixtures/statcan/expected/98100039.json +125 -0
- pyivt-0.0.1/tests/fixtures/statcan/expected/98100044.json +185 -0
- pyivt-0.0.1/tests/fixtures/statcan/expected/98100047.json +153 -0
- pyivt-0.0.1/tests/fixtures/statcan/expected/98100123.json +229 -0
- pyivt-0.0.1/tests/fixtures/statcan/expected/98100125.json +229 -0
- pyivt-0.0.1/tests/fixtures/statcan/manifest.json +52 -0
- pyivt-0.0.1/tests/metadata_expected.py +111 -0
- pyivt-0.0.1/tests/scripts/download.py +99 -0
- pyivt-0.0.1/tests/scripts/dump_expected_metadata.py +73 -0
- pyivt-0.0.1/tests/scripts/link_demo_ivts.py +61 -0
- pyivt-0.0.1/tests/test_demo_metadata.py +62 -0
- pyivt-0.0.1/tests/test_metadata.py +70 -0
- pyivt-0.0.1/tests/test_units.py +17 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
ci:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
16
|
+
|
|
17
|
+
- uses: Swatinem/rust-cache@v2
|
|
18
|
+
|
|
19
|
+
- uses: astral-sh/setup-uv@v6
|
|
20
|
+
with:
|
|
21
|
+
enable-cache: true
|
|
22
|
+
python-version: "3.12"
|
|
23
|
+
|
|
24
|
+
- name: Install package
|
|
25
|
+
run: uv sync --extra dev
|
|
26
|
+
|
|
27
|
+
- name: Lint
|
|
28
|
+
run: uv run ruff check .
|
|
29
|
+
|
|
30
|
+
- name: Format
|
|
31
|
+
run: uv run ruff format --check .
|
|
32
|
+
|
|
33
|
+
- name: Rust tests
|
|
34
|
+
run: cargo test
|
|
35
|
+
|
|
36
|
+
- name: Download fixtures
|
|
37
|
+
run: uv run python tests/scripts/download.py
|
|
38
|
+
|
|
39
|
+
- name: Test
|
|
40
|
+
run: uv run pytest
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Build abi3 wheels + sdist; publish to PyPI on version tags.
|
|
2
|
+
# Configure a Trusted Publisher on PyPI for this repo/workflow before the first tag.
|
|
3
|
+
name: Release
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
tags:
|
|
8
|
+
- "v*"
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
linux:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
target: [x86_64, aarch64]
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.10"
|
|
26
|
+
|
|
27
|
+
- name: Build wheels
|
|
28
|
+
uses: PyO3/maturin-action@v1
|
|
29
|
+
with:
|
|
30
|
+
target: ${{ matrix.target }}
|
|
31
|
+
args: --release --out dist -i 3.10
|
|
32
|
+
manylinux: "2_28"
|
|
33
|
+
sccache: "true"
|
|
34
|
+
|
|
35
|
+
- name: Upload wheels
|
|
36
|
+
uses: actions/upload-artifact@v4
|
|
37
|
+
with:
|
|
38
|
+
name: wheels-linux-${{ matrix.target }}
|
|
39
|
+
path: dist
|
|
40
|
+
|
|
41
|
+
windows:
|
|
42
|
+
runs-on: windows-latest
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/checkout@v4
|
|
45
|
+
|
|
46
|
+
- uses: actions/setup-python@v5
|
|
47
|
+
with:
|
|
48
|
+
python-version: "3.10"
|
|
49
|
+
|
|
50
|
+
- name: Build wheels
|
|
51
|
+
uses: PyO3/maturin-action@v1
|
|
52
|
+
with:
|
|
53
|
+
target: x64
|
|
54
|
+
args: --release --out dist -i 3.10
|
|
55
|
+
sccache: "true"
|
|
56
|
+
|
|
57
|
+
- name: Upload wheels
|
|
58
|
+
uses: actions/upload-artifact@v4
|
|
59
|
+
with:
|
|
60
|
+
name: wheels-windows-x64
|
|
61
|
+
path: dist
|
|
62
|
+
|
|
63
|
+
macos:
|
|
64
|
+
runs-on: macos-15
|
|
65
|
+
strategy:
|
|
66
|
+
matrix:
|
|
67
|
+
target: [x86_64, aarch64]
|
|
68
|
+
steps:
|
|
69
|
+
- uses: actions/checkout@v4
|
|
70
|
+
|
|
71
|
+
- uses: actions/setup-python@v5
|
|
72
|
+
with:
|
|
73
|
+
python-version: "3.10"
|
|
74
|
+
|
|
75
|
+
- name: Build wheels
|
|
76
|
+
uses: PyO3/maturin-action@v1
|
|
77
|
+
with:
|
|
78
|
+
target: ${{ matrix.target }}
|
|
79
|
+
args: --release --out dist -i 3.10
|
|
80
|
+
sccache: "true"
|
|
81
|
+
|
|
82
|
+
- name: Upload wheels
|
|
83
|
+
uses: actions/upload-artifact@v4
|
|
84
|
+
with:
|
|
85
|
+
name: wheels-macos-${{ matrix.target }}
|
|
86
|
+
path: dist
|
|
87
|
+
|
|
88
|
+
sdist:
|
|
89
|
+
runs-on: ubuntu-latest
|
|
90
|
+
steps:
|
|
91
|
+
- uses: actions/checkout@v4
|
|
92
|
+
|
|
93
|
+
- name: Build sdist
|
|
94
|
+
uses: PyO3/maturin-action@v1
|
|
95
|
+
with:
|
|
96
|
+
command: sdist
|
|
97
|
+
args: --out dist
|
|
98
|
+
|
|
99
|
+
- name: Upload sdist
|
|
100
|
+
uses: actions/upload-artifact@v4
|
|
101
|
+
with:
|
|
102
|
+
name: wheels-sdist
|
|
103
|
+
path: dist
|
|
104
|
+
|
|
105
|
+
publish:
|
|
106
|
+
name: Publish to PyPI
|
|
107
|
+
needs: [linux, windows, macos, sdist]
|
|
108
|
+
runs-on: ubuntu-latest
|
|
109
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
110
|
+
permissions:
|
|
111
|
+
id-token: write
|
|
112
|
+
# Configure PyPI Trusted Publisher: owner natebabyak, repo pyivt, workflow release.yml
|
|
113
|
+
steps:
|
|
114
|
+
- name: Download artifacts
|
|
115
|
+
uses: actions/download-artifact@v4
|
|
116
|
+
with:
|
|
117
|
+
pattern: wheels-*
|
|
118
|
+
path: dist
|
|
119
|
+
merge-multiple: true
|
|
120
|
+
|
|
121
|
+
# Trusted Publishing (OIDC). First-time:
|
|
122
|
+
# https://pypi.org/manage/account/publishing/
|
|
123
|
+
# Owner: natebabyak Repo: pyivt Workflow: release.yml
|
|
124
|
+
- name: Publish to PyPI
|
|
125
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
126
|
+
with:
|
|
127
|
+
packages-dir: dist/
|
pyivt-0.0.1/.gitignore
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*.pyd
|
|
4
|
+
*.so
|
|
5
|
+
*.dll
|
|
6
|
+
*.pdb
|
|
7
|
+
*.egg-info/
|
|
8
|
+
.eggs/
|
|
9
|
+
dist/
|
|
10
|
+
build/
|
|
11
|
+
.pytest_cache/
|
|
12
|
+
.venv/
|
|
13
|
+
venv/
|
|
14
|
+
*.parquet
|
|
15
|
+
*.IVT
|
|
16
|
+
*.ivt
|
|
17
|
+
tests/fixtures/statcan/*.zip
|
|
18
|
+
.mypy_cache/
|
|
19
|
+
|
|
20
|
+
# Cargo / maturin build outputs
|
|
21
|
+
/target
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"editor.formatOnSave": true,
|
|
3
|
+
"[json]": {
|
|
4
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
5
|
+
},
|
|
6
|
+
"[jsonc]": {
|
|
7
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
8
|
+
},
|
|
9
|
+
"[markdown]": {
|
|
10
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
11
|
+
},
|
|
12
|
+
"[python]": {
|
|
13
|
+
"editor.codeActionsOnSave": {
|
|
14
|
+
"source.fixAll.ruff": "explicit"
|
|
15
|
+
},
|
|
16
|
+
"editor.defaultFormatter": "charliermarsh.ruff"
|
|
17
|
+
},
|
|
18
|
+
"[toml]": {
|
|
19
|
+
"editor.defaultFormatter": "tombi-toml.tombi"
|
|
20
|
+
}
|
|
21
|
+
}
|
pyivt-0.0.1/CHANGELOG.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.0.1] - 2026-10-18
|
|
9
|
+
|
|
10
|
+
First public release: Rust/PyO3 reader for Statistics Canada Beyond 20/20 `.ivt` files.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `pyivt.open(source)` — open from path, bytes-like buffer, or binary file object
|
|
15
|
+
- Typed metadata (`IvtMetadata`, `LocalizedText`, `TimeSeries`, `Dimension`, `Geographies`, `Footnote`, `MissingValue`) with lazy-loaded heavy fields
|
|
16
|
+
- `Ivt.to_arrow(complete=, max_cells=, labels=, language=)` — published grid as an Apache Arrow table (via pyarrow)
|
|
17
|
+
- PEP 561 type stubs (`py.typed`, `_native.pyi`)
|
|
18
|
+
- StatCan golden metadata integration tests; Beyond demo fixtures when available locally
|
|
19
|
+
|
|
20
|
+
### Known limitations
|
|
21
|
+
|
|
22
|
+
- `Dimension.ordinal` is always `None`; footnote `scope` / `dimension` / `member_id` are unused
|
|
23
|
+
- Metadata golden snapshots do not assert geographies or cell values (Arrow tests check row counts)
|
|
24
|
+
- Some StatCan fixtures lock truncated dimension names or noisy footnote bytes from current parsing
|
|
25
|
+
- Demo IVT tests skip in CI unless Beyond sample files are linked locally
|
|
26
|
+
- No CLI or catalogue download; write Parquet yourself via `pyarrow` / Polars / pandas
|
|
27
|
+
|
|
28
|
+
[0.0.1]: https://github.com/natebabyak/pyivt/releases/tag/v0.0.1
|