Skip to main content

BOXR is a Better Open Exchange Rate client – at least better than I was able to find because this one is maintained.

Install

$ pip install boxr

Usage

Boxr maps 1:1 with the OXR api documented here: https://docs.openexchangerates.org/docs/. This means https://openexchangerates.org/api/latest.json maps to boxr.latest(), and https://openexchangerates.org/api/historical/:date.json maps to boxr.historical(date).

In short

  • Routes map to function names, e.g. /latest.json -> latest()

  • Path params map to function arguments, e.g. /historical/:date.json -> historical(date)

  • Query params map to keyword arguments, e.g. /time-series.json?start=2017-01-01&end=2017-01-05 -> time_series(start="2017-01-01", end='2017-01-05')

Also note that all endpoints return requests response objects, so things like validation of request or formatting the response can be done by interacting with the response object.

Example usage

from boxr import Boxr

boxr = Boxr(app_id='your_app_id')

# All calls return a `requests` Response object
latest = boxr.latest()

# And thus we get the json
result = latest.json()

Contributing

I would like this package to always be up to date with the OXR http API. If this is someday not the case please open a Pull Request or open an issue about the noncompliance.

Release files for boxr 1.0.1

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

Source distribution (sdist)

Source distribution for boxr 1.0.1
File Size Uploaded
boxr-1.0.1.tar.gz 3.3 kB Details

Release files / boxr-1.0.1.tar.gz

Download URL boxr-1.0.1.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6934989b35d1103ae3756fae1640dcd85d25afedca58523a99b59b65bbbfe97e
BLAKE2b-256 checksum
How to use checksums
e320ededa82afac011965fe1b11815ff11dd8fecd1081c57dcd31e22c48c33a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file

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