v0.3.0
⚠️ Breaking release
This release renames the year-month value type and everything named after it, and ships the first Python bindings on PyPI.
Python bindings — new
pip install hmrc-rates (Python ≥ 3.10). abi3 wheels for Linux (glibc + musl, x86_64 + aarch64), macOS (universal2) and Windows (x64); the sdist builds anywhere with a Rust toolchain.
from decimal import Decimal
from hmrc_rates import YearMonth, Rates, YearEnd
rates = Rates()
rate = rates.monthly_rate("USD", YearMonth(2025, 8)) # also accepts datetime.date or "2025-08"
gbp = rate.to_gbp(Decimal("2500")) # exact decimal.Decimal — you choose the roundingBreaking changes
Rust crate
Month→YearMonth, andParseMonthError→ParseYearMonthError.montharguments →year_monthonRates::monthly_rate,monthly_rate_or_earlier,monthly.YearEnd::from_month→from_year_month;YearEnd::end_month→end_year_month.Period::Monthvariant →Period::YearMonth.- Serde wire format changed: a
Periodnow serializes as{"year_month": "2025-08"}(previously{"month": …}). Data serialized by earlier versions will not deserialize. - The dependency pin is now
hmrc-rates = "0.3".
Python
- Class
Month→YearMonth; type aliasMonthLike→YearMonthLike. - Keyword argument
month=→year_month=on the lookup methods. YearEnd.from_month→from_year_month;YearEnd.end_month→end_year_month.Period.kindnow returns"year_month"(was"month"); thePeriod.monthproperty is nowPeriod.year_month.
Unchanged
YearMonth.month/.year (the numeric 1–12 month and the year), RateType/MONTHLY, the monthly*() lookups, the exception hierarchy, and the bundled data coverage.