eolas-data 1.3.13__tar.gz → 1.3.14__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.
Files changed (41) hide show
  1. eolas_data-1.3.14/.github/workflows/pre-release.yml +50 -0
  2. eolas_data-1.3.14/.github/workflows/publish.yml +103 -0
  3. {eolas_data-1.3.13 → eolas_data-1.3.14}/.github/workflows/smoke.yml +11 -1
  4. eolas_data-1.3.14/.github/workflows/test.yml +81 -0
  5. {eolas_data-1.3.13 → eolas_data-1.3.14}/PKG-INFO +1 -1
  6. {eolas_data-1.3.13 → eolas_data-1.3.14}/eolas_data/client.py +12 -1
  7. {eolas_data-1.3.13 → eolas_data-1.3.14}/pyproject.toml +1 -1
  8. eolas_data-1.3.14/scripts/check_client_contract.py +61 -0
  9. eolas_data-1.3.13/.github/workflows/publish.yml +0 -49
  10. eolas_data-1.3.13/.github/workflows/test.yml +0 -40
  11. {eolas_data-1.3.13 → eolas_data-1.3.14}/.github/workflows/catalog-drift.yml +0 -0
  12. {eolas_data-1.3.13 → eolas_data-1.3.14}/.gitignore +0 -0
  13. {eolas_data-1.3.13 → eolas_data-1.3.14}/README.md +0 -0
  14. {eolas_data-1.3.13 → eolas_data-1.3.14}/eolas_data/__init__.py +0 -0
  15. {eolas_data-1.3.13 → eolas_data-1.3.14}/eolas_data/_dataset_names.py +0 -0
  16. {eolas_data-1.3.13 → eolas_data-1.3.14}/eolas_data/_regen_names.py +0 -0
  17. {eolas_data-1.3.13 → eolas_data-1.3.14}/eolas_data/cdc.py +0 -0
  18. {eolas_data-1.3.13 → eolas_data-1.3.14}/eolas_data/cli.py +0 -0
  19. {eolas_data-1.3.13 → eolas_data-1.3.14}/eolas_data/console.py +0 -0
  20. {eolas_data-1.3.13 → eolas_data-1.3.14}/eolas_data/dataset.py +0 -0
  21. {eolas_data-1.3.13 → eolas_data-1.3.14}/eolas_data/exceptions.py +0 -0
  22. {eolas_data-1.3.13 → eolas_data-1.3.14}/eolas_data/library.py +0 -0
  23. {eolas_data-1.3.13 → eolas_data-1.3.14}/eolas_data/meta.py +0 -0
  24. {eolas_data-1.3.13 → eolas_data-1.3.14}/eolas_data/rows.py +0 -0
  25. {eolas_data-1.3.13 → eolas_data-1.3.14}/eolas_data/schedule.py +0 -0
  26. {eolas_data-1.3.13 → eolas_data-1.3.14}/eolas_data/search.py +0 -0
  27. {eolas_data-1.3.13 → eolas_data-1.3.14}/scripts/preflight.sh +0 -0
  28. {eolas_data-1.3.13 → eolas_data-1.3.14}/tests/test_as_arrow.py +0 -0
  29. {eolas_data-1.3.13 → eolas_data-1.3.14}/tests/test_cdc_roundtrip.py +0 -0
  30. {eolas_data-1.3.13 → eolas_data-1.3.14}/tests/test_cli.py +0 -0
  31. {eolas_data-1.3.13 → eolas_data-1.3.14}/tests/test_client.py +0 -0
  32. {eolas_data-1.3.13 → eolas_data-1.3.14}/tests/test_keyring.py +0 -0
  33. {eolas_data-1.3.13 → eolas_data-1.3.14}/tests/test_library.py +0 -0
  34. {eolas_data-1.3.13 → eolas_data-1.3.14}/tests/test_meta.py +0 -0
  35. {eolas_data-1.3.13 → eolas_data-1.3.14}/tests/test_progress.py +0 -0
  36. {eolas_data-1.3.13 → eolas_data-1.3.14}/tests/test_rows.py +0 -0
  37. {eolas_data-1.3.13 → eolas_data-1.3.14}/tests/test_schedule.py +0 -0
  38. {eolas_data-1.3.13 → eolas_data-1.3.14}/tests/test_search.py +0 -0
  39. {eolas_data-1.3.13 → eolas_data-1.3.14}/tests/test_smoke_live.py +0 -0
  40. {eolas_data-1.3.13 → eolas_data-1.3.14}/tests/test_sync_bulk.py +0 -0
  41. {eolas_data-1.3.13 → eolas_data-1.3.14}/tests/test_sync_changes.py +0 -0
@@ -0,0 +1,50 @@
1
+ name: Pre-release gate
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ gate:
8
+ runs-on: ubuntu-latest
9
+ env:
10
+ PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: "3.12"
16
+
17
+ - name: Client contract matrix
18
+ run: python scripts/check_client_contract.py
19
+
20
+ - name: Build + install wheel
21
+ run: |
22
+ pip install build
23
+ python -m build
24
+ WHL=$(ls -1 dist/*.whl | head -1)
25
+ pip install "$WHL"
26
+ pip install pytest responses geopandas shapely pandas pyarrow typer rich keyring
27
+
28
+ - name: Unit tests (installed package)
29
+ run: pytest -q -m "not integration"
30
+
31
+ - name: Live smoke
32
+ env:
33
+ EOLAS_API_KEY: ${{ secrets.EOLAS_API_KEY }}
34
+ run: |
35
+ if [ -z "$EOLAS_API_KEY" ]; then
36
+ echo "::error::EOLAS_API_KEY secret required for pre-release smoke."
37
+ exit 1
38
+ fi
39
+ pytest -q -m integration tests/test_smoke_live.py
40
+
41
+ - name: Version parity with eolas-r
42
+ run: |
43
+ set -euo pipefail
44
+ py_ver=$(grep -E '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
45
+ r_ver=$(curl -fsSL "https://raw.githubusercontent.com/phildonovan/eolas-r/master/DESCRIPTION" \
46
+ | awk -F': ' '/^Version:/{print $2; exit}')
47
+ echo "Python: $py_ver | R (master): $r_ver"
48
+ if [ "$py_ver" != "$r_ver" ]; then
49
+ echo "::warning::Client versions differ — bump both before tagging if shipping related fixes"
50
+ fi
@@ -0,0 +1,103 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ version-parity:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - name: Compare tag to eolas-r DESCRIPTION
14
+ env:
15
+ TAG: ${{ github.ref_name }}
16
+ run: |
17
+ set -euo pipefail
18
+ expected="${TAG#v}"
19
+ r_ver=$(curl -fsSL "https://raw.githubusercontent.com/phildonovan/eolas-r/master/DESCRIPTION" \
20
+ | awk -F': ' '/^Version:/{print $2; exit}')
21
+ py_ver=$(grep -E '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
22
+ echo "Tag: $expected | R: $r_ver | Python (pyproject): $py_ver"
23
+ if [ "$expected" != "$py_ver" ]; then
24
+ echo "::error::Tag $TAG does not match pyproject.toml version $py_ver"
25
+ exit 1
26
+ fi
27
+ if [ "$expected" != "$r_ver" ]; then
28
+ echo "::warning::R package version ($r_ver) differs from tag ($expected) — align releases when possible"
29
+ fi
30
+
31
+ test:
32
+ runs-on: ubuntu-latest
33
+ needs: version-parity
34
+ env:
35
+ PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+
39
+ - uses: actions/setup-python@v5
40
+ with:
41
+ python-version: "3.12"
42
+
43
+ - name: Build wheel
44
+ run: pip install build && python -m build
45
+
46
+ - name: Install wheel + test deps
47
+ run: |
48
+ WHL=$(ls -1 dist/*.whl | head -1)
49
+ pip install "$WHL"
50
+ pip install pytest responses geopandas shapely pandas pyarrow typer rich keyring
51
+
52
+ - name: Client contract matrix
53
+ run: python scripts/check_client_contract.py
54
+
55
+ - name: pytest
56
+ run: pytest -q -m "not integration"
57
+
58
+ smoke:
59
+ runs-on: ubuntu-latest
60
+ needs: test
61
+ steps:
62
+ - uses: actions/checkout@v4
63
+ - uses: actions/setup-python@v5
64
+ with:
65
+ python-version: "3.12"
66
+ - name: Install package from tag
67
+ run: pip install ".[dev,geo]"
68
+ - name: Live smoke (pre-publish gate)
69
+ env:
70
+ EOLAS_API_KEY: ${{ secrets.EOLAS_API_KEY }}
71
+ run: |
72
+ if [ -z "$EOLAS_API_KEY" ]; then
73
+ echo "::warning::EOLAS_API_KEY not set — skipping publish smoke"
74
+ exit 0
75
+ fi
76
+ pytest -q -m integration tests/test_smoke_live.py
77
+
78
+ publish:
79
+ needs: [test, smoke]
80
+ if: needs.test.result == 'success'
81
+ runs-on: ubuntu-latest
82
+ environment: pypi
83
+ permissions:
84
+ id-token: write
85
+
86
+ steps:
87
+ - uses: actions/checkout@v4
88
+
89
+ - uses: actions/setup-python@v5
90
+ with:
91
+ python-version: "3.12"
92
+
93
+ - name: Install build tools
94
+ run: pip install build
95
+
96
+ - name: Build
97
+ run: python -m build
98
+
99
+ - name: Publish to PyPI
100
+ uses: pypa/gh-action-pypi-publish@release/v1
101
+ with:
102
+ # Uses PYPI_API_TOKEN when set; otherwise OIDC trusted publishing.
103
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -15,6 +15,16 @@ jobs:
15
15
  with:
16
16
  python-version: "3.12"
17
17
 
18
+ - name: Require API key on manual runs
19
+ if: github.event_name == 'workflow_dispatch'
20
+ env:
21
+ EOLAS_API_KEY: ${{ secrets.EOLAS_API_KEY }}
22
+ run: |
23
+ if [ -z "$EOLAS_API_KEY" ]; then
24
+ echo "::error::EOLAS_API_KEY secret is required for workflow_dispatch smoke runs."
25
+ exit 1
26
+ fi
27
+
18
28
  - name: Install package + dev/geo deps (as users would)
19
29
  run: pip install ".[dev,geo]"
20
30
 
@@ -23,7 +33,7 @@ jobs:
23
33
  EOLAS_API_KEY: ${{ secrets.EOLAS_API_KEY }}
24
34
  run: |
25
35
  if [ -z "$EOLAS_API_KEY" ]; then
26
- echo "EOLAS_API_KEY secret not configured — skipping smoke tests."
36
+ echo "EOLAS_API_KEY secret not configured — skipping scheduled smoke tests."
27
37
  exit 0
28
38
  fi
29
39
  pytest -q -m integration tests/test_smoke_live.py
@@ -0,0 +1,81 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+
8
+ jobs:
9
+ contract:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: "3.12"
16
+ - name: Client contract matrix
17
+ run: python scripts/check_client_contract.py
18
+
19
+ test:
20
+ runs-on: ubuntu-latest
21
+ needs: contract
22
+ strategy:
23
+ fail-fast: false
24
+ matrix:
25
+ python-version: ["3.10", "3.12", "3.13"]
26
+ env:
27
+ PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+
31
+ - uses: actions/setup-python@v5
32
+ with:
33
+ python-version: ${{ matrix.python-version }}
34
+
35
+ - name: Install package + dev + geo + secure (editable)
36
+ run: pip install -e ".[dev,geo,secure]"
37
+
38
+ - name: pytest (unit suite)
39
+ run: pytest -q -m "not integration"
40
+
41
+ test-installed:
42
+ runs-on: ubuntu-latest
43
+ needs: contract
44
+ env:
45
+ PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
46
+ steps:
47
+ - uses: actions/checkout@v4
48
+
49
+ - uses: actions/setup-python@v5
50
+ with:
51
+ python-version: "3.12"
52
+
53
+ - name: Build wheel
54
+ run: pip install build && python -m build
55
+
56
+ - name: Install built wheel + test deps (as users would)
57
+ run: |
58
+ WHL=$(ls -1 dist/*.whl | head -1)
59
+ pip install "$WHL"
60
+ pip install pytest responses geopandas shapely pandas pyarrow typer rich keyring
61
+
62
+ - name: pytest on installed package
63
+ run: pytest -q -m "not integration"
64
+
65
+ coverage:
66
+ runs-on: ubuntu-latest
67
+ needs: contract
68
+ env:
69
+ PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
70
+ steps:
71
+ - uses: actions/checkout@v4
72
+ - uses: actions/setup-python@v5
73
+ with:
74
+ python-version: "3.12"
75
+ - run: pip install -e ".[dev,geo,secure]" pytest-cov
76
+ - run: pytest -q -m "not integration" --cov=eolas_data --cov-report=xml
77
+ - name: Upload coverage
78
+ uses: codecov/codecov-action@v4
79
+ with:
80
+ files: coverage.xml
81
+ fail_ci_if_error: false
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eolas-data
3
- Version: 1.3.13
3
+ Version: 1.3.14
4
4
  Summary: Python client for the eolas.fyi statistical data API (NZ, Australia, OECD)
5
5
  Project-URL: Homepage, https://eolas.fyi
6
6
  Project-URL: Documentation, https://docs.eolas.fyi/
@@ -2063,6 +2063,7 @@ class Client:
2063
2063
  meta: bool = True,
2064
2064
  envelope: bool = False,
2065
2065
  force: bool = False,
2066
+ progress: ProgressControl = None,
2066
2067
  ) -> Dataset:
2067
2068
  """Fetch dataset rows as a pandas (or polars / geopandas) DataFrame.
2068
2069
 
@@ -2103,6 +2104,11 @@ class Client:
2103
2104
  envelope: When ``True``, request ``?envelope=1`` (JSON only) and
2104
2105
  attach the ``data_sources`` licence block alongside rows.
2105
2106
  Response ``X-Eolas-*`` headers are merged into metadata.
2107
+ force: When ``True`` and the request auto-routes to :meth:`get_local`,
2108
+ re-download the bulk file even when the sidecar says current.
2109
+ progress: Control bulk download/read progress when auto-routed to
2110
+ :meth:`get_local`. ``None`` auto-detects TTY; ignored on the
2111
+ live API path.
2106
2112
 
2107
2113
  Returns:
2108
2114
  A :class:`Dataset` (pandas DataFrame subclass), a polars DataFrame
@@ -2148,7 +2154,12 @@ class Client:
2148
2154
  info_meta = self._info_cached(name)
2149
2155
  if self._bulk_export_allowed(info_meta) and self._live_pull_blocked(info_meta):
2150
2156
  result = self.get_local(
2151
- name, as_geo=as_geo, as_arrow=False, meta=meta, force=force,
2157
+ name,
2158
+ as_geo=as_geo,
2159
+ as_arrow=False,
2160
+ meta=meta,
2161
+ force=force,
2162
+ progress=progress,
2152
2163
  )
2153
2164
  if engine == "polars":
2154
2165
  try:
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "eolas-data"
7
- version = "1.3.13"
7
+ version = "1.3.14"
8
8
  description = "Python client for the eolas.fyi statistical data API (NZ, Australia, OECD)"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env python3
2
+ """Verify parity scenario tests from eolas/docs/client-contract.md exist locally.
3
+
4
+ Run in CI and before release. Cross-repo version parity is checked separately
5
+ in .github/workflows/version-parity.yml on tag push.
6
+ """
7
+ from __future__ import annotations
8
+
9
+ import pathlib
10
+ import sys
11
+
12
+ ROOT = pathlib.Path(__file__).resolve().parents[1]
13
+ TESTS = ROOT / "tests"
14
+
15
+ # filename -> substrings that must appear in that file
16
+ REQUIRED: dict[str, list[str]] = {
17
+ "test_progress.py": [
18
+ "test_download_bulk_missing_content_length",
19
+ "Deliberately no Content-Length",
20
+ ],
21
+ "test_sync_bulk.py": [
22
+ "test_sync_bulk_force_redownloads_when_unchanged",
23
+ "test_cache_clear_removes_files_and_session_meta",
24
+ ],
25
+ "test_client.py": [
26
+ "test_get_whole_dataset_defers_to_get_local_for_large_geo",
27
+ ],
28
+ "test_meta.py": [
29
+ "test_attach_meta_geodataframe_head_does_not_break_repr",
30
+ ],
31
+ "test_smoke_live.py": [
32
+ "test_linz_nz_addresses_bulk_route_and_head",
33
+ "test_client_exports_cache_clear",
34
+ ],
35
+ }
36
+
37
+
38
+ def main() -> int:
39
+ errors: list[str] = []
40
+ for filename, patterns in REQUIRED.items():
41
+ path = TESTS / filename
42
+ if not path.exists():
43
+ errors.append(f"missing test file: {filename}")
44
+ continue
45
+ text = path.read_text(encoding="utf-8")
46
+ for pat in patterns:
47
+ if pat not in text:
48
+ errors.append(f"{filename}: missing required pattern {pat!r}")
49
+
50
+ if errors:
51
+ print("Client contract check FAILED (see eolas/docs/client-contract.md):")
52
+ for err in errors:
53
+ print(f" - {err}")
54
+ return 1
55
+
56
+ print("Client contract check OK (Python)")
57
+ return 0
58
+
59
+
60
+ if __name__ == "__main__":
61
+ sys.exit(main())
@@ -1,49 +0,0 @@
1
- name: Publish to PyPI
2
-
3
- on:
4
- push:
5
- tags:
6
- - "v*"
7
-
8
- jobs:
9
- test:
10
- runs-on: ubuntu-latest
11
- env:
12
- PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
13
- steps:
14
- - uses: actions/checkout@v4
15
-
16
- - uses: actions/setup-python@v5
17
- with:
18
- python-version: "3.12"
19
-
20
- - name: Install package + dev deps
21
- run: pip install -e ".[dev,secure]"
22
-
23
- - name: pytest
24
- run: pytest -q -m "not integration"
25
-
26
- publish:
27
- needs: test
28
- runs-on: ubuntu-latest
29
- environment: pypi
30
- permissions:
31
- id-token: write
32
-
33
- steps:
34
- - uses: actions/checkout@v4
35
-
36
- - uses: actions/setup-python@v5
37
- with:
38
- python-version: "3.12"
39
-
40
- - name: Install build tools
41
- run: pip install hatchling build
42
-
43
- - name: Build
44
- run: python -m build
45
-
46
- - name: Publish to PyPI
47
- uses: pypa/gh-action-pypi-publish@release/v1
48
- with:
49
- password: ${{ secrets.PYPI_API_TOKEN }}
@@ -1,40 +0,0 @@
1
- name: Tests
2
-
3
- on:
4
- push:
5
- branches: [master]
6
- pull_request:
7
-
8
- jobs:
9
- test:
10
- runs-on: ubuntu-latest
11
- strategy:
12
- fail-fast: false
13
- matrix:
14
- python-version: ["3.10", "3.12", "3.13"]
15
- env:
16
- PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
17
- steps:
18
- - uses: actions/checkout@v4
19
-
20
- - uses: actions/setup-python@v5
21
- with:
22
- python-version: ${{ matrix.python-version }}
23
-
24
- - name: Install package + dev + secure (install-tests the keyring extra)
25
- run: pip install -e ".[dev,secure]"
26
-
27
- - name: pytest (unit suite)
28
- run: pytest -q -m "not integration"
29
-
30
- coverage:
31
- runs-on: ubuntu-latest
32
- env:
33
- PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
34
- steps:
35
- - uses: actions/checkout@v4
36
- - uses: actions/setup-python@v5
37
- with:
38
- python-version: "3.12"
39
- - run: pip install -e ".[dev,secure]" pytest-cov
40
- - run: pytest -q -m "not integration" --cov=eolas_data --cov-report=term-missing
File without changes
File without changes