Skip to main content

django-money-rates

https://badge.fury.io/py/django-money-rates.png https://travis-ci.org/evonove/django-money-rates.png?branch=master https://coveralls.io/repos/evonove/django-money-rates/badge.png https://pypip.in/d/django-money-rates/badge.png

Currency conversion for money

Documentation

The full documentation is at https://django-money-rates.readthedocs.io/.

Quickstart

Install django-money-rates:

pip install django-money-rates

Then use it in a project:

import djmoney_rates

In order to save exchange rates to your database, add djmoney_rates to your INSTALLED_APPS in your project’s settings:

INSTALLED_APPS = (
    ...
    'djmoney_rates',
    ...
)

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:

DJANGO_MONEY_RATES = {
    'DEFAULT_BACKEND': 'djmoney_rates.backends.OpenExchangeBackend',
    'OPENEXCHANGE_URL': 'http://openexchangerates.org/api/latest.json',
    'OPENEXCHANGE_APP_ID': 'YOUR APP ID HERE',
    'OPENEXCHANGE_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 djmoney_rates.utils import convert_money
brl_money = convert_money(10, "EUR", "BRL")

Features

  • Convert money from one currency to another with an easy to use API.

TODO List

  • Add money converter wrapper for util’s convert_money function.

  • Add celery periodic task for getting daily exchange rates.

Metadata

Release files for django-money-rates-nb 0.3.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 django-money-rates-nb 0.3.1
File Size Uploaded Provenance Actions
django-money-rates-nb-0.3.1.tar.gz 11.9 kB Without provenance Details for django-money-rates-nb-0.3.1.tar.gz

Release files / django-money-rates-nb-0.3.1.tar.gz

Download URL django-money-rates-nb-0.3.1.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7bafa271f3e25a37d1f5b09dc35daadfa69d8787d86aaa21cdaf3f150ad7aa00
BLAKE2b-256 checksum
How to use checksums
d385e01d1107dfa742efb011ccb76148cef2cd21b39c82c99987e591b36bc59f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-money-rates-nb 0.3.1

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.1 This release

1 release file No provenance

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