Skip to main content

django-exchange

Currency, exchange rate and conversions support for django projects.

Install

django-exchange is available on pypi repositories so youre free to use pip or easy_install:

$ pip install django-exchange

Or you might want to install from source:

$ wget https://github.com/metglobal/django-exchange/archive/django-exchange-xxx.zip
$ unzip django-exchange-xxx.zip
$ cd django-exchange-xxx
$ python setup.py install

Add exchange into your INSTALLED_APPS settings of your django project:

INSTALLED_APPS += [
    'exchange',
]

Don’t forget to sync your db to create corresponding database tables:

$ python manage.py syncdb

Populating Data

django-exchange supports populating currency and exchange rates using a service provider automatically. Currently it has built in support for openexchangerates.org service. It is only a matter of supplying an api key obtained from http://openexchangerates.org as django settings using the key OPENEXCHANGERATES_API_KEY:

OPENEXCHANGERATES_API_KEY = '<YOU_API_KEY_HERE>'

Now you can populate you currency and exchange rates magically by typing:

$ python manage.py update_rates

Quickstart

Currency conversions is dead easy. There are auxilaray methods helps you calculate conversions using populated exchange rates under exchange.conversions module.

Take a look at the example below:

>>> from exchange.conversion import Price, convert
>>> my_price = Price(50, 'USD')
>>> convert(my_price, 'EUR')
<Price(value=Decimal('36.68585000'), currency='EUR')>

Documentation

Coming soon…

Todo

  • Convenient template tags

  • Django price field implementation supporting currency conversions

  • Easier api with convenient refaactorings

  • A few more builtin exchange rate provider

Metadata

Release files for django-exchange 0.7.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 django-exchange 0.7.2
File Size Uploaded Provenance
django-exchange-0.7.2.tar.gz 11.4 kB Without provenance Details

Release files / django-exchange-0.7.2.tar.gz

Download URL django-exchange-0.7.2.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
97dc38c3ac0ea4226262047b3a0b2fb3e7cdd0a5900d9b123fac3c0da54039fc
BLAKE2b-256 checksum
How to use checksums
96f8fc32a5fb0281c742f0205b8dda1dcc2d0be0876d888018d78b8ac74a68b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-exchange 0.7.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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