beanprice source for official Swiss BAZG/EZV (Federal Customs) daily FX rates, quoted in CHF
Project description
beanprice-bazg
A beanprice price source for the official Swiss BAZG/EZV daily exchange rates (Bundesamt für Zoll und Grenzsicherheit, formerly Eidgenössische Zollverwaltung).
These are the rates the Swiss tax administration (ESTV) accepts for converting foreign-currency amounts on VAT returns, quoted directly in CHF — which is exactly what a CHF-reporting company needs, and what the ECB feed does not provide.
Install
This package is developed inside the quints
monorepo and isn't published to PyPI separately (only quints is). Use it from
a clone of the repo, or vendor src/beanprice_bazg/ into your own project.
Usage
Tickers are ISO currency codes; the quote currency is always CHF
("1 <ticker> = X CHF"):
2024-01-01 commodity USD
price: "CHF:beanprice_bazg/USD"
2024-01-01 commodity EUR
price: "CHF:beanprice_bazg/EUR"
bean-price -e CHF:beanprice_bazg/USD # latest
bean-price --update --inactive main.bean # backfill / refresh the series
Behaviour
- Daily, fully historical.
get_historical_price/get_prices_serieshit…/api/xmldaily?d=YYYYMMDD, which serves any past date. - Weekends & holidays resolve to the last published rate; series results are de-duplicated by the actual rate date, giving a clean business-day series.
- Per-100 quotes (e.g.
100 EGP) are normalised to a per-unit CHF price. - Monthly averages are intentionally not supported: the BAZG monthly-average endpoint only ever returns the current month, so it cannot be backfilled by an automated tool. Use the daily rate consistently instead.
Develop / test
uv sync
uv run pytest # offline unit tests (HTTP mocked)
BAZG_LIVE=1 uv run pytest # also runs the live smoke test
License
GPL-2.0-only
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file beanprice_bazg-0.2.0.tar.gz.
File metadata
- Download URL: beanprice_bazg-0.2.0.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
545ebfbe5ec30ff1f52de4106299e1d225ed97a6b06253baac2c1e6c662dae25
|
|
| MD5 |
1b6e5cd5c5672eb49ab3443c9a04832a
|
|
| BLAKE2b-256 |
9fa9f46a7904605a604744224dcad2414dbb25b1bdd611eafb907168f4faa0e7
|
Provenance
The following attestation bundles were made for beanprice_bazg-0.2.0.tar.gz:
Publisher:
publish.yaml on sealambda/quints
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
beanprice_bazg-0.2.0.tar.gz -
Subject digest:
545ebfbe5ec30ff1f52de4106299e1d225ed97a6b06253baac2c1e6c662dae25 - Sigstore transparency entry: 2190482909
- Sigstore integration time:
-
Permalink:
sealambda/quints@2078bf13e1d03747bae82eee036cca2252c6d512 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/sealambda
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@2078bf13e1d03747bae82eee036cca2252c6d512 -
Trigger Event:
push
-
Statement type:
File details
Details for the file beanprice_bazg-0.2.0-py3-none-any.whl.
File metadata
- Download URL: beanprice_bazg-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e872d6fdaa3f34390ffc73fccf195e888c0ad17641ab86c6f059a301c099cfa
|
|
| MD5 |
5861a3e306cb9516c9fad1deb4f37fc9
|
|
| BLAKE2b-256 |
1eea549bacf317175bb0d629ddad38aa18aa3785b47da78f1f244280bfd36af6
|
Provenance
The following attestation bundles were made for beanprice_bazg-0.2.0-py3-none-any.whl:
Publisher:
publish.yaml on sealambda/quints
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
beanprice_bazg-0.2.0-py3-none-any.whl -
Subject digest:
5e872d6fdaa3f34390ffc73fccf195e888c0ad17641ab86c6f059a301c099cfa - Sigstore transparency entry: 2190482918
- Sigstore integration time:
-
Permalink:
sealambda/quints@2078bf13e1d03747bae82eee036cca2252c6d512 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/sealambda
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@2078bf13e1d03747bae82eee036cca2252c6d512 -
Trigger Event:
push
-
Statement type: