Currency conversion
Project description
Currency conversion
# WORK IN PROGRESS.
Quickstart
Install currency_open_exchange:
pip install currency-open-exchange
Then use it in a project:
import currency_open_exchange
In order to save exchange rates to your database, add currency_open_exchange to your INSTALLED_APPS in your project’s settings:
INSTALLED_APPS = ( ... 'currency_open_exchange', ... )
Setup the Open Exchange Rates backend
Open an account at https://openexchangerates.org/ if you don’t have one already. Then, add this to your project’s settings:
'EXCHANGE_APP_ID': 'YOUR APP ID HERE', 'EXCHANGE_BASE_CURRENCY': 'USD',
For more information on the Open Exchange Rates API, see https://openexchangerates.org/
Pull the latest Exchange Rates
Once your backend is setup, get the latest exchange rates:
$ ./manage.py update_rates
Convert from one currency to another
Here’s an example of converting 10 Euros to Brazilian Reais:
from moneyed import Money
from currency_open_exchange.utils import convert
amount, currency = convert(10, "EUR", "BRL")
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
Close
Hashes for currency_open_exchange-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ca8298f844fffb6653ef89329cbb99f8a0b0ffe93e01d8eac31b9ae811f99ba |
|
MD5 | 3fba3d6e25ed46c303d34a3837312c9d |
|
BLAKE2b-256 | e140c507335eb8ad132ed7ce71a20744af10e2459540e46a7e3fc933ebe19e59 |
Close
Hashes for currency_open_exchange-0.0.5-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab779786ea38b2316d35da545a89839c80dc81856b4908cb8b389589880fd29a |
|
MD5 | 22e047efee1766a0d769c1f658e6bb0f |
|
BLAKE2b-256 | e68a7faf8bd2210769da504d1446b087cfc6fd9848574a2feb42cddd1c80422e |