All Projects → mirumee → Prices

mirumee / Prices

Licence: other
Python price handling for humans.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Prices

Javamoney Lib
JavaMoney financial libraries, extending and complementing JSR 354
Stars: ✭ 104 (-58.06%)
Mutual labels:  currency, currencies, money
Django Prices
Django fields for the prices module
Stars: ✭ 135 (-45.56%)
Mutual labels:  currency, currencies, money
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 (-65.73%)
Mutual labels:  currency, currencies, money
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 (-89.52%)
Mutual labels:  money, currency, currencies
django-prices-openexchangerates
openexchangerates.org support for django-prices
Stars: ✭ 33 (-86.69%)
Mutual labels:  money, currency, currencies
Cash Cli
💰💰 Convert currency rates directly from your terminal!
Stars: ✭ 168 (-32.26%)
Mutual labels:  currency, currencies, money
currency-converter
💰 Easily convert between 32 currencies
Stars: ✭ 16 (-93.55%)
Mutual labels:  money, currency, currencies
react-local-currency
💵 💴Shows the price of your services in the customer's currency 💶 💷
Stars: ✭ 21 (-91.53%)
Mutual labels:  money, currency, currencies
Fixer
A foreign exchange rates and currency conversion API
Stars: ✭ 2,545 (+926.21%)
Mutual labels:  currencies, money
Ryal
🏵 An e-commerce library for elixir; just to save you some pain, we're still in construction, so star us instead or donate!
Stars: ✭ 87 (-64.92%)
Mutual labels:  e-commerce, money
Money Open Exchange Rates
A gem that calculates the exchange rate using published rates from open-exchange-rates. Compatible with the money gem.
Stars: ✭ 87 (-64.92%)
Mutual labels:  currency, money
Currency
Handles currency calculations, storage etc
Stars: ✭ 109 (-56.05%)
Mutual labels:  currency, currencies
Frankfurter
💱 Currency data API
Stars: ✭ 123 (-50.4%)
Mutual labels:  currency, money
Exchanger
🏢 Currency exchange rates framework for PHP
Stars: ✭ 133 (-46.37%)
Mutual labels:  currency, money
Currencyconverter
Utilities for doing currency conversion with the Money library
Stars: ✭ 78 (-68.55%)
Mutual labels:  currency, money
Swap
💱 Currency exchange rates library
Stars: ✭ 1,195 (+381.85%)
Mutual labels:  currency, money
Oxr
💱 Node.js wrapper for the Open Exchange Rates API
Stars: ✭ 72 (-70.97%)
Mutual labels:  currencies, money
Ngx Currency
📦 Currency mask module for Angular
Stars: ✭ 161 (-35.08%)
Mutual labels:  currency, money
Easymoney
Library for operating with monetary values in JavaScript and Typescript 💵
Stars: ✭ 145 (-41.53%)
Mutual labels:  currency, money
Currency.js
A javascript library for handling currencies
Stars: ✭ 2,214 (+792.74%)
Mutual labels:  currency, money

Prices: Python price handling for humans

Build Status codecov.io


Money:

from prices import Money
a = Money(10, 'USD')
a += Money(20, 'USD')
a.value
# Decimal('30')
a = a.quantize()
a.value
# Decimal('30.00')
a = Money('5.00', 'JPY')
a.quantize()
a.value
# Decimal('5')

Taxed money:

from prices import Money, TaxedMoney
p = TaxedMoney(net=Money(20, 'EUR'), gross=Money(30, 'EUR'))
p.net
# Money('20', 'EUR')
p.gross
# Money('30', 'EUR')
p.tax
# Money('10', 'EUR')
p = p.quantize()
p.net
# Money('20.00', 'EUR')

Taxed ranges:

from prices import Money, TaxedMoney, TaxedMoneyRange
price1 = TaxedMoney(Money(1, 'USD'), Money(1, 'USD'))
price2 = TaxedMoney(Money(10, 'USD'), Money(10, 'USD'))
pr = TaxedMoneyRange(price1, price2)
pr.min_price
# TaxedMoney(net=Money('1', 'USD'), gross=Money('1', 'USD'))
pr.max_price
# TaxedMoney(net=Money('10', 'USD'), gross=Money('10', 'USD'))
price3 = TaxedMoney(net=Money(5, 'USD'), gross=Money(5, 'USD'))
price3 in pr
# True
pr = pr.quantize()
pr.min_price.net
# Money('1.00', 'USD')

Taxes:

from decimal import Decimal
from prices import Money, TaxedMoney, TaxedMoneyRange, flat_tax
p = TaxedMoney(Money('1.99', 'GBP'), Money('1.99', 'GBP'))
p = flat_tax(p, Decimal('0.23'))
p = p.quantize()
p.gross
# Money('2.45', 'GBP')

While protecting you from all sorts of mistakes:

from prices import Money
Money(10, 'USD') < Money(15, 'GBP')
# ValueError: Cannot compare amounts in 'USD' and 'GBP'
from prices import Money, TaxedMoney
price1 = TaxedMoney(Money(5, 'BTC'), Money(5, 'BTC'))
price2 = TaxedMoney(Money(7, 'INR'), Money(7, 'INR'))
price1 + price2
# ValueError: Cannot add amount in 'BTC' to 'INR'
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].