readabs 0.2.2__tar.gz → 0.2.4__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 (53) hide show
  1. {readabs-0.2.2 → readabs-0.2.4}/CHANGELOG.md +43 -0
  2. {readabs-0.2.2 → readabs-0.2.4}/PKG-INFO +3 -3
  3. {readabs-0.2.2 → readabs-0.2.4}/README.md +2 -2
  4. readabs-0.2.4/TODO.md +23 -0
  5. {readabs-0.2.2 → readabs-0.2.4}/docs/readabs/read_abs_by_desc.html +1 -1
  6. {readabs-0.2.2 → readabs-0.2.4}/docs/readabs/read_abs_cat.html +629 -622
  7. {readabs-0.2.2 → readabs-0.2.4}/docs/readabs/read_abs_series.html +2 -2
  8. {readabs-0.2.2 → readabs-0.2.4}/docs/readabs/search_abs_meta.html +8 -8
  9. {readabs-0.2.2 → readabs-0.2.4}/docs/readabs/splice.html +785 -730
  10. {readabs-0.2.2 → readabs-0.2.4}/docs/readabs.html +416 -400
  11. readabs-0.2.4/docs/search.js +46 -0
  12. {readabs-0.2.2 → readabs-0.2.4}/pyproject.toml +1 -1
  13. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/download_cache.py +129 -37
  14. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/grab_abs_url.py +1 -3
  15. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/read_abs_by_desc.py +1 -1
  16. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/read_abs_cat.py +18 -10
  17. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/read_abs_series.py +10 -3
  18. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/read_support.py +4 -5
  19. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/recalibrate.py +5 -3
  20. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/search_abs_meta.py +4 -4
  21. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/utilities.py +1 -1
  22. readabs-0.2.4/test/test_offline_fallback.py +158 -0
  23. {readabs-0.2.2 → readabs-0.2.4}/uv.lock +73 -73
  24. readabs-0.2.2/docs/search.js +0 -46
  25. {readabs-0.2.2 → readabs-0.2.4}/.gitignore +0 -0
  26. {readabs-0.2.2 → readabs-0.2.4}/.pylintrc +0 -0
  27. {readabs-0.2.2 → readabs-0.2.4}/.python-version +0 -0
  28. {readabs-0.2.2 → readabs-0.2.4}/LICENSE +0 -0
  29. {readabs-0.2.2 → readabs-0.2.4}/build-all.sh +0 -0
  30. {readabs-0.2.2 → readabs-0.2.4}/build-docs.sh +0 -0
  31. {readabs-0.2.2 → readabs-0.2.4}/docs/index.html +0 -0
  32. {readabs-0.2.2 → readabs-0.2.4}/docs/readabs/abs_catalogue.html +0 -0
  33. {readabs-0.2.2 → readabs-0.2.4}/docs/readabs/grab_abs_url.html +0 -0
  34. {readabs-0.2.2 → readabs-0.2.4}/docs/readabs/print_abs_catalogue.html +0 -0
  35. {readabs-0.2.2 → readabs-0.2.4}/docs/readabs/rba_catalogue.html +0 -0
  36. {readabs-0.2.2 → readabs-0.2.4}/docs/readabs/read_rba_table.html +0 -0
  37. {readabs-0.2.2 → readabs-0.2.4}/docs/readabs/recalibrate.html +0 -0
  38. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/.test-data/Qrtly-CPI-Time-series-spreadsheets-all.zip +0 -0
  39. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/__init__.py +0 -0
  40. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/abs_catalogue.py +0 -0
  41. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/abs_meta_data.py +0 -0
  42. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/datatype.py +0 -0
  43. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/get_abs_links.py +0 -0
  44. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/lint-all.sh +0 -0
  45. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/print_abs_catalogue.py +0 -0
  46. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/py.typed +0 -0
  47. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/rba_catalogue.py +0 -0
  48. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/rba_meta_data.py +0 -0
  49. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/read_rba_table.py +0 -0
  50. {readabs-0.2.2 → readabs-0.2.4}/src/readabs/splice.py +0 -0
  51. {readabs-0.2.2 → readabs-0.2.4}/test/test.py +0 -0
  52. {readabs-0.2.2 → readabs-0.2.4}/test/test_url_retrieval.py +0 -0
  53. {readabs-0.2.2 → readabs-0.2.4}/uv-upgrade.sh +0 -0
@@ -1,3 +1,46 @@
1
+ Version 0.2.4 released 21-Jun-2026 (Canberra Australia)
2
+
3
+ - Offline fallback: when fresh data cannot be downloaded (for example, there is
4
+ no internet connection), `get_file()` now returns a previously cached copy
5
+ with a prominent warning that the data may be out of date. The intent is to
6
+ let you keep working with your existing cached data while offline — e.g. on a
7
+ plane. Previously the freshness `HEAD` request was made before the cache was
8
+ ever consulted, so being offline raised a connection error on the very first
9
+ step. An error is now only raised when there is no cached copy to fall back to
10
+ (and `ignore_errors` is not set). This covers every retrieval path, as they
11
+ all funnel through `get_file()`.
12
+ - Caveat: the fallback can only return what is already in the cache. If the ABS
13
+ catalogue was never cached, the catalogue-based entry points can do nothing
14
+ offline, because a catalogue number is resolved to a URL via the catalogue.
15
+ Likewise, offline `grab_abs_url()` needs the landing page to have been cached,
16
+ since the file links are discovered by parsing it.
17
+ - `url` is now an explicit parameter of `read_abs_cat()` and `read_abs_series()`
18
+ (with a `""` default), instead of being smuggled through `**kwargs` as a
19
+ `ReadArgs` member. Existing calls are unaffected. This also fixes a latent bug
20
+ where a `url` passed to `read_abs_series()` was silently dropped (and so never
21
+ reached the download), and resolves the associated type-checker complaints.
22
+ - Type-checking cleanups (no behavioural change): `recalibrate()` now narrows
23
+ the Series/DataFrame branches so the column-label/series-name restoration is
24
+ type-safe (removing a `# pyright: ignore`), and `grab_abs_url()` reads Excel
25
+ sheets via `pd.read_excel()`. `mypy` now passes cleanly over `src/`.
26
+ - Docs: fixed a README example that called `read_abs_cat(url=...)` without the
27
+ required `cat` catalogue number.
28
+
29
+ ---
30
+
31
+ Version 0.2.3 released 19-Jun-2026 (Canberra Australia)
32
+
33
+ - Pandas 3.0 compatibility: removed the deprecated `copy=` keyword from the
34
+ `set_axis()` call in `qtly_to_monthly()` (Copy-on-Write makes it redundant).
35
+ This was the only deprecated pandas usage in the package; the conversion is
36
+ unchanged and the caller's input series is still left untouched.
37
+ - Refreshed the modules' built-in self-tests for current ABS structures: the
38
+ labour-force (6202.0) and CPI (6401.0) table identifiers are now 8 digits, and
39
+ the trimmed-mean CPI example series is updated to the monthly series. The
40
+ local-zip test in `read_abs_cat` now skips cleanly when the fixture is absent.
41
+
42
+ ---
43
+
1
44
  Version 0.2.2 released 04-Jun-2026 (Canberra Australia)
2
45
 
3
46
  - A *selector* (in `select_one()`, `select()` and `select_and_splice()` sources)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: readabs
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Get ABS timeseries data in pandas DataFrames
5
5
  Project-URL: Repository, https://github.com/bpalmer4/readabs
6
6
  Project-URL: Homepage, https://github.com/bpalmer4/readabs
@@ -143,8 +143,8 @@ data_dict = ra.grab_abs_url(url="https://www.abs.gov.au/some/archived/page")
143
143
  # Access historical releases using the history parameter
144
144
  data, meta = ra.read_abs_cat("6202.0", history="dec-2023")
145
145
 
146
- # Or use a direct URL with read_abs_cat
147
- data, meta = ra.read_abs_cat(url="https://www.abs.gov.au/statistics/...")
146
+ # Or fetch a discontinued series by URL (the catalogue number is still required)
147
+ data, meta = ra.read_abs_cat("8501.0", url="https://www.abs.gov.au/statistics/...")
148
148
  ```
149
149
 
150
150
  These functions return a dictionary of DataFrames (one per Excel sheet), allowing you to work with data that may have been removed from the main ABS catalogue.
@@ -121,8 +121,8 @@ data_dict = ra.grab_abs_url(url="https://www.abs.gov.au/some/archived/page")
121
121
  # Access historical releases using the history parameter
122
122
  data, meta = ra.read_abs_cat("6202.0", history="dec-2023")
123
123
 
124
- # Or use a direct URL with read_abs_cat
125
- data, meta = ra.read_abs_cat(url="https://www.abs.gov.au/statistics/...")
124
+ # Or fetch a discontinued series by URL (the catalogue number is still required)
125
+ data, meta = ra.read_abs_cat("8501.0", url="https://www.abs.gov.au/statistics/...")
126
126
  ```
127
127
 
128
128
  These functions return a dictionary of DataFrames (one per Excel sheet), allowing you to work with data that may have been removed from the main ABS catalogue.
readabs-0.2.4/TODO.md ADDED
@@ -0,0 +1,23 @@
1
+ # TODO
2
+
3
+ ## Type-checker issues (pre-existing, not runtime bugs)
4
+
5
+ These are flagged by `pyright src/readabs` and/or `mypy src/readabs`. All 14
6
+ module self-tests pass; these are type-checker friction only.
7
+
8
+ - [ ] **`grab_abs_url.py` — `url` declared twice.** `grab_abs_url()` has an explicit
9
+ `url: str = ""` parameter *and* `**kwargs: Unpack[ReadArgs]`, where `ReadArgs`
10
+ also declares `url: NotRequired[str]` (`read_support.py:29`). This produces three
11
+ errors: the param/TypedDict overlap (line 37/40) and the `check_kwargs`/`get_args`
12
+ arg-type mismatches (lines 78-79). `read_support.py:33` already documents that
13
+ `url` is meant to be handled separately — fix by dropping `url` from `ReadArgs`.
14
+
15
+ - [ ] **`grab_abs_url.py:359` — `ExcelFile.parse` not in stubs.** `excel.parse(sheet_name)`
16
+ works at runtime but the pandas type stubs don't expose `.parse` on `ExcelFile`.
17
+ Add a targeted `# type: ignore` / `# pyright: ignore`, or switch to `pd.read_excel`.
18
+
19
+ - [ ] **`recalibrate.py:78,80` — `Series | DataFrame` union not narrowed by `.shape`.**
20
+ `result` is typed `Series | DataFrame`; the `len(data.shape) == ...` guards don't
21
+ narrow the runtime class, so `result.columns` (line 78) and `result.name` (line 80)
22
+ each flag on the type that lacks the attribute. Narrow the branches with
23
+ `isinstance` so both checkers agree.
@@ -360,7 +360,7 @@ by their descriptions rather than series IDs.</p>
360
360
  </span><span id="L-299"><a href="#L-299"><span class="linenos">299</span></a> <span class="k">def</span><span class="w"> </span><span class="nf">test2</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
361
361
  </span><span id="L-300"><a href="#L-300"><span class="linenos">300</span></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;Test case: get a dictionary of dids.&quot;&quot;&quot;</span>
362
362
  </span><span id="L-301"><a href="#L-301"><span class="linenos">301</span></a> <span class="n">gdp_table</span> <span class="o">=</span> <span class="s2">&quot;5206001_Key_Aggregates&quot;</span>
363
- </span><span id="L-302"><a href="#L-302"><span class="linenos">302</span></a> <span class="n">uer_table</span> <span class="o">=</span> <span class="s2">&quot;6202001&quot;</span>
363
+ </span><span id="L-302"><a href="#L-302"><span class="linenos">302</span></a> <span class="n">uer_table</span> <span class="o">=</span> <span class="s2">&quot;62020001&quot;</span>
364
364
  </span><span id="L-303"><a href="#L-303"><span class="linenos">303</span></a> <span class="n">sa</span> <span class="o">=</span> <span class="s2">&quot;Seasonally Adjusted&quot;</span>
365
365
  </span><span id="L-304"><a href="#L-304"><span class="linenos">304</span></a> <span class="n">get_these</span> <span class="o">=</span> <span class="p">{</span>
366
366
  </span><span id="L-305"><a href="#L-305"><span class="linenos">305</span></a> <span class="c1"># two series, each from two different ABS Catalogue Numbers</span>