Skip to main content

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_series hit …/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

Metadata

Release files for beanprice-bazg 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beanprice-bazg 0.2.2
File Size Uploaded
beanprice_bazg-0.2.2.tar.gz 14.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beanprice-bazg 0.2.2
File Interpreter ABI Platform
beanprice_bazg-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 27.2 kB

Release files / beanprice_bazg-0.2.2.tar.gz

Download URL beanprice_bazg-0.2.2.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d50b4c81c4716d49c9402adb0a2203945538221d270dd936f5968d4dd6aebdf4
BLAKE2b-256 checksum
How to use checksums
af6bcad9a0cc3d30f5fdbf8b17e9a03f3688627978c841e346ca553cc5e024e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / beanprice_bazg-0.2.2-py3-none-any.whl

Download URL beanprice_bazg-0.2.2-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7003df1eb896cc3332cc1064282bc926c8e4c5c3e0df5e4e01e7022301cce5ba
BLAKE2b-256 checksum
How to use checksums
cfc73aac7abb1c5b7632a436f566cc5c7e99d1c7c3840b1a2a1076e38eaba5ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page