Skip to main content

Currency conversion

Project description

Currency conversion


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:


Setup the Open Exchange Rates backend

Open an account at if you don’t have one already. Then, add this to your project’s settings:

'EXCHANGE_BASE_CURRENCY': 'USD' (optional, only USD for free accounts)

For more information on the Open Exchange Rates API, see

Pull the latest Exchange Rates

Once your backend is setup, get the latest exchange rates:

$ ./ update_rates

Convert from one currency to another

Here’s an example of converting 10 American Dollars to Chinese Renminbi:

from currency_open_exchange.utils import convert
amount, currency = convert(10, "EUR", "BRL")

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

currency_open_exchange-0.0.6.tar.gz (4.9 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page