Display money format and its filthy currencies, for all money lovers out there.

Overview

Python Currencies

Display money format and its filthy currencies, for all money lovers out there.

Build Status https://codecov.io/gh/Alir3z4/python-currencies/branch/master/graph/badge.svg?token=Ag25YMSuEX

Installation

currencies is available on PyPi

http://pypi.python.org/pypi/currencies

So easily install it by pip

$ pip install currencies

Or by easy_install

$ easy_install currencies

Another way is by cloning currencies's git repo

$ git clone git://github.com/Alir3z4/python-currencies.git

Then install it by running:

$ python setup.py install

Usage

Displaying money format:

>>> from currencies import Currency
>>>
>>> currency = Currency('USD')
>>> currency.get_money_format(13)
>>> '$13'
>>> currency.get_money_format(13.99)
>>> '$13.99'
>>> currency.get_money_format('13,2313,33')
>>> '$13,2313,33'
>>>
>>> # Displaying with currency as well
>>>
>>> currency.get_money_with_currency_format(13)
>>> '$13 USD'
>>> currency.get_money_with_currency_format(13.99)
>>> '$13.99 USD'
>>> currency.get_money_with_currency_format('13,2313,33')
>>> '$13,2313,33 USD'

Tests

currencies is well tested, to run the test suite:

$ PYTHONPATH=$PYTHONPATH:. python setup.py test

Available currencies

  • AED
  • AFN
  • ALL
  • AMD
  • ANG
  • AOA
  • ARS
  • AUD
  • AWG
  • AZN
  • BAM
  • BBD
  • BDT
  • BGN
  • BHD
  • BND
  • BOB
  • BRL
  • BSD
  • BTN
  • BWP
  • BYR
  • BZD
  • CAD
  • CHF
  • CLP
  • CNY
  • COP
  • CRC
  • CZK
  • DKK
  • DOP
  • DZD
  • EGP
  • ETB
  • EUR
  • FJD
  • GBP
  • GEL
  • GHS
  • GMD
  • GTQ
  • GYD
  • HKD
  • HNL
  • HRK
  • HUF
  • IDR
  • ILS
  • INR
  • ISK
  • JEP
  • JMD
  • JOD
  • JPY
  • KES
  • KGS
  • KHR
  • KRW
  • KWD
  • KYD
  • KZT
  • LBP
  • LKR
  • LTL
  • LVL
  • MAD
  • MDL
  • MGA
  • MKD
  • MMK
  • MNT
  • MOP
  • MUR
  • MVR
  • MXN
  • MYR
  • MZN
  • NAD
  • NGN
  • NIO
  • NOK
  • NPR
  • NZD
  • OMR
  • PEN
  • PGK
  • PHP
  • PKR
  • PLN
  • PYG
  • QAR
  • RON
  • RSD
  • RUB
  • RWF
  • SAR
  • SCR
  • SEK
  • SGD
  • STD
  • SYP
  • THB
  • TND
  • TRY
  • TTD
  • TWD
  • TZS
  • UAH
  • UGX
  • USD
  • UYU
  • VEF
  • VND
  • VUV
  • WST
  • XAF
  • XBT
  • XCD
  • XOF
  • XPF
  • ZAR
  • ZMW

Source https://github.com/Alir3z4/python-currencies
Website http://alir3z4.github.com/python-currencies
Issues https://github.com/Alir3z4/python-currencies/issues
PyPi http://pypi.python.org/pypi/currencies
Author Alireza Savand
License GNU GPL 3
Comments
  • Should symbol work?

    Should symbol work?

    Should this work?

    >>> pycountry.currencies.lookup(u'EUR')
    Currency(alpha_3='EUR', name='Euro', numeric='978')
    >>> pycountry.currencies.lookup(u'€')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/Users/michele/bitbucket/splitti/telegram/venv36/lib/python3.6/site-packages/pycountry/db.py", line 43, in load_if_needed
        return f(self, *args, **kw)
      File "/Users/michele/bitbucket/splitti/telegram/venv36/lib/python3.6/site-packages/pycountry/db.py", line 121, in lookup
        raise LookupError('Could not find a record for %r' % value)
    LookupError: Could not find a record for '€'
    
    opened by mmic 2
  • Make Currencies comparable

    Make Currencies comparable

    Hi there! Out of curiosity, was there any decision behind not implementing the __eq__ method inside the Currency class?

    In my - maybe naive - understanding, it would make sense to be able to compare Currency objects like so: Currency('USD') == Currency('USD') which as of now returns False, as the object's pointers are compared, not the values.

    My workaround for this is as follows (python 3.10 code, for python < 3.10 the __ne__ method also needs to be implemented)

    class ComparableCurrency(Currency):
        def __eq__(self, other):
            return isinstance(other, Currency) and self.get_money_currency() == other.get_money_currency()
    

    If for any reason, it doesn't make sense to compare two Currencies with each other, or the implementation on currency.get_money_currency() is too simple, I would really like to undestand the problems with that.

    opened by CGaul 0
  • Adding functionality for Full Currency Name look up

    Adding functionality for Full Currency Name look up

    What is the purpose of your pull request?

    As per Issue: https://github.com/Alir3z4/python-currencies/issues/12

    To add functionality to the main class whereby you can get the full currency name.

    Important

    • Added JSON file to 'currencies' folder called "currency_name.json"
    • This JSON file is a basic key/value setup
    • Most of these full name values should be the official/correct ones
    • Source is mainly Google preview after search, as well as https://www.worlddata.info/currencies

    Useage

    from currencies import Currency

    currency = Currency('USD')

    currency.getname()

    >>> 'United States Dollar'

    Other Info

    Resolves https://github.com/Alir3z4/python-currencies/issues/12 which can be closed now

    opened by Connor-Steward 1
  • Adding the currency Name

    Adding the currency Name

    It would be really great if the library would know the full name of the currency. For example:

    >>> Currency('USD').get_name()
    "United States dollar"
    

    or

    >>> Currency('EUR').get_name()
    "Euro"
    

    I think english names would be a good starting point, but I think there should be a way to translate the names? I thought of JSON files for each language that contains the name for each currency. The library could then choose the correct file automatically.

    opened by mame98 4
  • Countries for currencies

    Countries for currencies

    Would be nice if you could just write the country and get the currency, like

    
    >>> portugal = Country('PORTUGAL')
    >>> portugal.get_currency()
    >>> EUR
    >>> portugal.get_money_format(13)
    >>> '€13'
    >>> portugal.get_money_format(13.99)
    >>> '€13.99'
    >>> portugal.get_money_format('13,2313,33')
    >>> '€13,2313,33'
    >>>
    >>> # Displaying with currency as well
    >>>
    >>> portugal.get_money_with_currency_format(13)
    >>> '€13 EUR'
    >>> portugal.get_money_with_currency_format(13.99)
    >>> '€13.99 EUR'
    >>> portugal.get_money_with_currency_format('13,2313,33')
    >>> '€13,2313,33 EUR'
    
    enhancement 
    opened by jusce17 2
Releases(2020.12.12)
Owner
Alireza Savand
I am Alireza Savand, a Software Architect.
Alireza Savand
Fully functional ecommerce website with user and guest checkout capabilities and Paypal payment integration.

ecommerce_website Fully functional ecommerce website with user and guest checkout capabilities and Paypal payment integration. pip install django pyth

null 2 Jan 5, 2022
Portfolio and E-commerce site built on Python-Django and Stripe checkout

StripeMe Introduction Stripe Me is an e-commerce and portfolio website offering communication services, including web-development, graphic design and

null 3 Jul 5, 2022
Foreign exchange rates, Bitcoin price index and currency conversion using ratesapi.io

forex-python Forex Python is a Free Foreign exchange rates and currency conversion. Note: Install latest forex-python==1.1 to avoid RatesNotAvailableE

MicroPyramid 540 Jan 5, 2023
A modular, high performance, headless e-commerce platform built with Python, GraphQL, Django, and React.

Saleor Commerce Customer-centric e-commerce on a modern stack A headless, GraphQL-first e-commerce platform delivering ultra-fast, dynamic, personaliz

Mirumee Labs 17.7k Dec 31, 2022
PVE with tcaledger app for payments and simulation of payment requests

tcaledger PVE with tcaledger app for payments and simulation of payment requests. The purpose of this API is to empower users to accept cryptocurrenci

null 3 Jan 29, 2022
An eBay-like e-commerce auction site that will allow users to post auction listings, place bids on listings, comment on those listings, and add listings to a watchlist.

e-commerce-auction-site This repository is my solution to Commerce project of CS50’s Web Programming with Python and JavaScript course by Harvard. ??

null 3 Sep 3, 2022
Ecommerce app using Django, Rest API and ElasticSearch

e-commerce-app Ecommerce app using Django, Rest API, Docker and ElasticSearch Sort pipfile pipfile-sort Runserver with Werkzeug (django-extensions) .

Nhat Tai NGUYEN 1 Jan 31, 2022
This is a database of 180.000+ symbols containing Equities, ETFs, Funds, Indices, Futures, Options, Currencies, Cryptocurrencies and Money Markets.

Finance Database As a private investor, the sheer amount of information that can be found on the internet is rather daunting.

Jeroen Bouma 1.4k Dec 31, 2022
This Project is based on NLTK It generates a RANDOM WORD from a predefined list of words, From that random word it read out the word, its meaning with parts of speech , its antonyms, its synonyms

This Project is based on NLTK(Natural Language Toolkit) It generates a RANDOM WORD from a predefined list of words, From that random word it read out the word, its meaning with parts of speech , its antonyms, its synonyms

SaiVenkatDhulipudi 2 Nov 17, 2021
A timer for bird lovers, plays a random birdcall while displaying its image and info.

Birdcall Timer A timer for bird lovers. Siriema hatchling by Junior Peres Junior Background My partner needed a customizable timer for sitting and sta

Marcelo Sanches 1 Jul 8, 2022
Two modules that display rates of fiat currencies and cryptocurrencies

currency-rates-polybar Two modules that display rates of fiat currencies and cryptocurrencies Setup Clone the repository somewhere Move (or create sym

Peskov Sergey 2 Apr 3, 2022
Pihole-eink-display - A simple Python script to display PiHole statistics on an eInk Display

Pihole-eink-display - A simple Python script to display PiHole statistics on an eInk Display

Mark McIntyre 64 Oct 11, 2022
Mini Tool to lovers of debe from eksisozluk (one of the most famous website -reffered as collaborative dictionary like reddit- in Turkey) for pushing debe (Most Liked Entries of Yesterday) to kindle every day via Github Actions.

debe to kindle Mini Tool to lovers of debe from eksisozluk (one of the most famous website -refered as collaborative dictionary like reddit- in Turkey

null 11 Oct 11, 2022
Currency Merger is a simple tool for joining values in different currencies

Currency Merger Description Currency Merger is a simple tool for joining values in different currencies. For example, if I have money in USD, EUR, BRL

Arthur Diniz 1 Feb 8, 2022
Face2webtoon - Despite its importance, there are few previous works applying I2I translation to webtoon.

Despite its importance, there are few previous works applying I2I translation to webtoon. I collected dataset from naver webtoon 연애혁명 and tried to transfer human faces to webtoon domain.

이상윤 64 Oct 19, 2022
This tool is created by Shahzain and is one of the best self bots out there!

Shahzain SelfBot This tool is created by Shahzain and is one of the best self bots out there! Features Token Destroyer! Server Nuker(50-100 Bans Per S

Shahzain 6 Apr 2, 2022
THERE IS AN IMPOSTER AMONG US. VOTE HIM OUT BEFORE HE [ R E D A C T E D ].

??️ Guardian There is an impostor among us. Can you help us find out who it is? ⚙️ Installation and Usage Make sure to install Tesseract-OCR before ru

Catus Magnus 1 Jan 6, 2022
An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and display it on a FeatherS2 in an OLED display.

CircuitPython IoT Trivia ESP32-S2 OLED Version An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and

Kevin Thomas 1 Nov 27, 2021
TB Set color display - Add-on for Blender to set multiple objects and material Display Color at once.

TB_Set_color_display Add-on for Blender with operations to transfer name between object, data, materials and action names Set groups of object's or ma

null 1 Jun 1, 2022