Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/xuhcc/beancount-exchangerates

Price source for Beancount that loads data from https://exchangerate.host/
https://github.com/xuhcc/beancount-exchangerates

beancount beancount-prices exchangeratesapi

Last synced: 12 days ago
JSON representation

Price source for Beancount that loads data from https://exchangerate.host/

Lists

README

        

# Beancount Exchange Rates

Price source for [Beancount](http://furius.ca/beancount/) that can load data from https://exchangerate.host/ or similar providers.

### exchangerate.host

List of supported forex currencies: https://api.exchangerate.host/symbols

No API key required.

## Installation

Install latest version with `pip`:

```
pip install https://github.com/xuhcc/beancount-exchangerates/archive/master.zip
```

## Usage

Source string format is `:beancount_exchangerates/:`.

Default API base url is https://api.frankfurter.app. It can be changed using `EXCHANGERATE_API_URL` environment variable to any service that implements Fixer API.

Data source can be changed using `EXCHANGERATE_SOURCE` environment variable.

Check https://api.exchangerate.host/sources for the complete list of sources.

### Examples

Evaluate source string with `bean-price`:

```
PYTHONPATH=.:$PYTHONPATH bean-price --no-cache -e 'RUB:beancount_exchangerates/USD:RUB'
```

Set price source for commodity in beancount file:

```
1970-01-01 commodity USD
price: "RUB:beancount_exchangerates/USD:RUB"
```