All Projects â†’ mirumee â†’ django-prices-openexchangerates

mirumee / django-prices-openexchangerates

Licence: BSD-3-Clause license
openexchangerates.org support for django-prices

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to django-prices-openexchangerates

react-local-currency
💵 💴Shows the price of your services in the customer's currency 💶 💷
Stars: ✭ 21 (-36.36%)
Mutual labels:  money, currency, price, currencies, openexchangerates
currency-converter
💰 Easily convert between 32 currencies
Stars: ✭ 16 (-51.52%)
Mutual labels:  money, currency, exchange, currencies
stockholm
💵 Modern Python library for working with money and monetary amounts. Human friendly and flexible approach for development. 100% test coverage + built-in support for GraphQL and Protocol Buffers transports using current best-practices.
Stars: ✭ 26 (-21.21%)
Mutual labels:  money, currency, exchange, currencies
Cash Cli
💰💰 Convert currency rates directly from your terminal!
Stars: ✭ 168 (+409.09%)
Mutual labels:  money, currency, exchange, currencies
Prices
Python price handling for humans.
Stars: ✭ 248 (+651.52%)
Mutual labels:  money, currency, currencies
Currency
Handles currency calculations, storage etc
Stars: ✭ 109 (+230.3%)
Mutual labels:  currency, exchange, currencies
money
Crystal shard for dealing with money and currency conversion
Stars: ✭ 26 (-21.21%)
Mutual labels:  money, currency, exchange
Countries
Countries - ISO 3166 (ISO3166-1, ISO3166, Digit, Alpha-2 and Alpha-3) countries codes and names (on eng and rus), ISO 4217 currency designators, ITU-T E.164 IDD calling phone codes, countries capitals, UN M.49 regions codes, ccTLD countries domains, IOC/NOC and FIFA letters codes, VERY FAST, NO maps[], NO slices[], NO init() funcs, NO external links/files/data, NO interface{}, NO specific dependencies, Databases/JSON/GOB/XML/CSV compatible, Emoji countries flags and currencies support, full support ISO-3166-1, ISO-4217, ITU-T E.164, Unicode CLDR and ccTLD standarts.
Stars: ✭ 85 (+157.58%)
Mutual labels:  money, currency, currencies
Cashify
💸 Lightweight currency conversion library, successor of money.js
Stars: ✭ 329 (+896.97%)
Mutual labels:  money, currency, exchange
Javamoney Lib
JavaMoney financial libraries, extending and complementing JSR 354
Stars: ✭ 104 (+215.15%)
Mutual labels:  money, currency, currencies
Django Prices
Django fields for the prices module
Stars: ✭ 135 (+309.09%)
Mutual labels:  money, currency, currencies
Megacoin
Welcome to Megacoin MΣC - Around the World!
Stars: ✭ 16 (-51.52%)
Mutual labels:  money, currency
Fixer
A foreign exchange rates and currency conversion API
Stars: ✭ 2,545 (+7612.12%)
Mutual labels:  money, currencies
Jsr354 Ri
JSR 354 - Moneta: Reference Implementation
Stars: ✭ 223 (+575.76%)
Mutual labels:  money, currency
latinum
Latinum is a framework for resource and currency calculations.
Stars: ✭ 109 (+230.3%)
Mutual labels:  money, currencies
mexbtcapi
The Multi-Exchange Bitcoin API offers a consistent high-level API across multiple bitcoin exchanges
Stars: ✭ 42 (+27.27%)
Mutual labels:  money, exchange
CurrencyEditText
A simple EditText input designed to input decimal and currency values.
Stars: ✭ 18 (-45.45%)
Mutual labels:  money, currency
bankster
Money Creation Made Easy
Stars: ✭ 30 (-9.09%)
Mutual labels:  money, currency
GoCurrency
Simple currency converter. Insert an amount, what currency to convert from and what currency to convert to.
Stars: ✭ 29 (-12.12%)
Mutual labels:  currency, currencies
nova-money-field
Money Field for Laravel Nova
Stars: ✭ 71 (+115.15%)
Mutual labels:  money, currency

openexchangerates.org support for django-prices

from prices import Money
from django_prices_openexchangerates import exchange_currency

converted_price = exchange_currency(Money(10, currency='USD'), 'EUR')
print(converted_price)
# Money('8.84040', currency='EUR')

It will also create additional steps if it cannot convert directly:

from prices import Money
from django_prices_openexchangerates import exchange_currency

converted_price = exchange_currency(Money(10, currency='GBP'), 'EUR')
print(converted_price)
# Money('13.31313588062401085236264978', currency='EUR')

The exchange_currency supports Money, TaxedMoney, MoneyRange and TaxedMoneyRange.

Template filters can be used with django-prices to convert currency, round amounts and display localized amounts in templates:

{% load prices_i18n %}
{% load prices_multicurrency %}

<p>Price: {{ foo.price.gross|in_currency:'USD'|amount }} ({{ foo.price.net|in_currency:'USD'|amount }} + {{ foo.price.tax|in_currency:'USD'|amount }} tax)</p>

Installation

First install the package:

pip install django-prices-openexchangerates

Then add 'django_prices_openexchangerates' to your INSTALLED_APPS.

Set following settings in your project's settings:

  • OPENEXCHANGERATES_API_KEY

  • OPENEXCHANGERATES_BASE_CURRENCY (defaults to 'USD', only premium accounts support other bases)

Use your admin console to create ConversionRate objects for each currency that you want to support.

Updating exchange rates

Fetch current rates from API with ./manage.py update_exchange_rates

Schedule this task in cron job or in celery, to be always up to date with exchange rates

You can use --all flag in above command, to create exchange rates automatically for all available currencies.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].