timeprice 0.4.0 → 0.5.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/README.md +18 -2
- data/data/cpi/eu.json +406 -403
- data/data/cpi/jp.json +78 -75
- data/data/cpi/uk.json +513 -510
- data/data/cpi/us.json +488 -485
- data/data/cpi/vn.json +342 -339
- data/data/fx/usd/1999.json +23 -7
- data/data/fx/usd/2000.json +23 -7
- data/data/fx/usd/2001.json +23 -7
- data/data/fx/usd/2002.json +23 -7
- data/data/fx/usd/2003.json +23 -7
- data/data/fx/usd/2004.json +23 -7
- data/data/fx/usd/2005.json +23 -7
- data/data/fx/usd/2006.json +23 -7
- data/data/fx/usd/2007.json +23 -7
- data/data/fx/usd/2008.json +23 -7
- data/data/fx/usd/2009.json +23 -7
- data/data/fx/usd/2010.json +23 -7
- data/data/fx/usd/2011.json +23 -7
- data/data/fx/usd/2012.json +23 -7
- data/data/fx/usd/2013.json +23 -7
- data/data/fx/usd/2014.json +23 -7
- data/data/fx/usd/2015.json +23 -7
- data/data/fx/usd/2016.json +23 -7
- data/data/fx/usd/2017.json +23 -7
- data/data/fx/usd/2018.json +23 -7
- data/data/fx/usd/2019.json +23 -7
- data/data/fx/usd/2020.json +23 -7
- data/data/fx/usd/2021.json +23 -7
- data/data/fx/usd/2022.json +23 -7
- data/data/fx/usd/2023.json +23 -7
- data/data/fx/usd/2024.json +23 -7
- data/data/fx/usd/2025.json +24 -5
- data/data/fx/usd/2026.json +24 -5
- data/data/fx/usd/_annual.json +145 -0
- data/data/manifest.json +90 -0
- data/lib/timeprice/compare.rb +1 -1
- data/lib/timeprice/cpi_lookup.rb +2 -2
- data/lib/timeprice/data_loader.rb +42 -7
- data/lib/timeprice/errors.rb +4 -4
- data/lib/timeprice/exchange.rb +8 -8
- data/lib/timeprice/inflation.rb +2 -2
- data/lib/timeprice/sources/coverage.rb +27 -32
- data/lib/timeprice/supported.rb +39 -22
- data/lib/timeprice/version.rb +1 -1
- data/lib/timeprice.rb +2 -2
- metadata +3 -15
- data/data/fx/usd/1983.json +0 -11
- data/data/fx/usd/1986.json +0 -11
- data/data/fx/usd/1987.json +0 -11
- data/data/fx/usd/1988.json +0 -11
- data/data/fx/usd/1989.json +0 -11
- data/data/fx/usd/1990.json +0 -11
- data/data/fx/usd/1991.json +0 -11
- data/data/fx/usd/1992.json +0 -11
- data/data/fx/usd/1993.json +0 -11
- data/data/fx/usd/1994.json +0 -11
- data/data/fx/usd/1995.json +0 -11
- data/data/fx/usd/1996.json +0 -11
- data/data/fx/usd/1997.json +0 -11
- data/data/fx/usd/1998.json +0 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6f5a76db32571e7ab2f09f9e22e1d90d420b5bdcf474baff6b523f2c8998c72b
|
|
4
|
+
data.tar.gz: 96e212aaa5aac2cfe4defc28364498ef49241de34161cb3e301f4886a19650d0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4148766e8c3dee2243ed933868d23cb2d79959db1581d07de654e1bab87325de98eacb2cd41200e1f765f3d94dde03472dc5d02a37e2e2f059fc8a651ac40666
|
|
7
|
+
data.tar.gz: a51e3132f616bc0e468b0f9afdff9ab71a2017abd25eed5ffd45cecc4c385d58f4670ffeeb5cc8bc5f4143f639a42d92f88a2d6e4f81957171d6c3207982d5ee
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,28 @@ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.5.0] - 2026-05-11
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- **Schema v2 → v3.** Breaking change to the bundled data contract. v0.4.x
|
|
12
|
+
data files will not load on v0.5.0.
|
|
13
|
+
- New top-level `data/manifest.json` — single source of truth for which
|
|
14
|
+
countries and currencies the bundle supports. `Supported.countries` /
|
|
15
|
+
`Supported.currencies` derive from it at runtime; the hardcoded Ruby
|
|
16
|
+
constants `Supported::COUNTRIES` / `CURRENCIES` are gone. Custom callers
|
|
17
|
+
that referenced those constants must switch to the method form.
|
|
18
|
+
- CPI files use nested `series: { monthly, annual }` and a structured
|
|
19
|
+
`index: { base_period, rebased_at }` block in place of the freeform
|
|
20
|
+
`base_year` string. Top-level `source` and `updated_at` removed —
|
|
21
|
+
`providers[]` is the source of truth for provenance.
|
|
22
|
+
- FX year files now carry `provenance` + `providers` blocks, symmetric
|
|
23
|
+
with CPI.
|
|
24
|
+
- All annual FX (today only VND from World Bank) lives in
|
|
25
|
+
`data/fx/usd/_annual.json` — the single canonical source, every year.
|
|
26
|
+
Per-year files (`data/fx/usd/<year>.json`) hold daily rates only. Pre-1999
|
|
27
|
+
stub year files are gone. `Exchange.lookup_usd_base` collapses to a
|
|
28
|
+
two-tier chain (daily → annual fallback), one source per tier.
|
|
29
|
+
|
|
8
30
|
## [0.4.0] - 2026-05-11
|
|
9
31
|
|
|
10
32
|
### Changed
|
data/README.md
CHANGED
|
@@ -101,8 +101,9 @@ Coverage is derived from the bundled `data/` files. Re-check with `timeprice sou
|
|
|
101
101
|
| Vietnam | VND | IMF Data Portal CPI dataflow (monthly primary) + World Bank `FP.CPI.TOTL` (annual fallback) | Monthly + annual | 1995 → present |
|
|
102
102
|
|
|
103
103
|
**FX (USD base):** ECB reference rates via Frankfurter for **EUR / GBP / JPY**, daily
|
|
104
|
-
1999 → present. **VND** uses the World Bank annual average (`PA.NUS.FCRF`)
|
|
105
|
-
|
|
104
|
+
1999 → present. **VND** uses the World Bank annual average (`PA.NUS.FCRF`), one value
|
|
105
|
+
per year, from 1983 → present. VND results are tagged `granularity: :annual` so callers
|
|
106
|
+
know they got the annual fallback rather than a daily rate.
|
|
106
107
|
|
|
107
108
|
Triangulated cross-rates (e.g. GBP → JPY) go through USD on the same effective date.
|
|
108
109
|
Weekend/holiday dates fall back up to 7 days to the nearest prior trading day.
|
|
@@ -265,6 +266,21 @@ license — see `DATA_LICENSES.md` and `NOTICE` for the full table and license U
|
|
|
265
266
|
If you redistribute results derived from this gem, reproduce the relevant attribution
|
|
266
267
|
strings. `timeprice sources` prints them in plain text and as JSON.
|
|
267
268
|
|
|
269
|
+
## Data format
|
|
270
|
+
|
|
271
|
+
Bundled data lives under `data/` in schema v3 and is self-describing:
|
|
272
|
+
|
|
273
|
+
- `data/manifest.json` — the supported set (countries, currencies, FX years).
|
|
274
|
+
- `data/cpi/<country>.json` — CPI for one country: `series.{monthly,annual}`,
|
|
275
|
+
structured `index` block, `provenance` ranges, `providers` attribution.
|
|
276
|
+
- `data/fx/usd/<year>.json` — daily USD-base FX rates for one year (one file
|
|
277
|
+
per year, EUR/GBP/JPY).
|
|
278
|
+
- `data/fx/usd/_annual.json` — annual USD-base FX rates across all years for
|
|
279
|
+
currencies sourced at annual resolution (today only VND). Used as the
|
|
280
|
+
fallback tier when no daily rate covers the requested date.
|
|
281
|
+
|
|
282
|
+
`scripts/check_schema_stability.rb` enforces the shape in CI.
|
|
283
|
+
|
|
268
284
|
## Author
|
|
269
285
|
|
|
270
286
|
Built by [Patrick](https://github.com/patrick204nqh).
|