Skip to main content

A Python package that converts currencies and validates currency codes.

Project description

CurrencyExchange

Currency Exchange is a Python package that allows your to verify whether a currency code (such as USD) is valid. In addition, it allows you to convert currency amounts to various other currecies.

How to use

import CurrencyExchange

currency = CurrencyExchange.Currency()

currency.convertCurrency(1, 'USD', 'EUR') # Convert 1 USD to 1 EUR
"""
This returns:
0.8485362749
"""

currency.validateCurrencyCode('USD') # Check to see if USD is a valid currency code
"""
This returns: 
(True, {'rates': {'CAD': 1.3171828596, 'HKD': 7.7503606279, 'ISK': 140.2630462452, 'PHP': 48.6491302503, 'DKK': 6.3137038608, 'HUF': 306.6355536699, 'CZK': 22.5040305473, 'GBP': 0.7675265168, 'RON': 4.123462028, 'SEK': 8.8022910479, 'IDR': 14860.033941451, 'INR': 73.9126007637, 'BRL': 5.382011031, 'RUB': 76.386338566, 'HRK': 6.392023759, 'JPY': 106.2367416207, 'THB': 31.4654221468, 'CHF': 0.9181162495, 'EUR': 0.8485362749, 'MYR': 4.1685193042, 'BGN': 1.6595672465, 'TRY': 7.4842596521, 'CNY': 6.8441238863, 'NOK': 9.0549851506, 'NZD': 1.5037759864, 'ZAR': 16.9735256682, 'USD': 1.0, 'MXN': 21.8655070004, 'SGD': 1.3703012304, 'AUD': 1.3819261773, 'ILS': 3.3919389054, 'KRW': 1189.7666525244, 'PLN': 3.7745439118}, 'base': 'USD', 'date': '2020-09-08'})
"""

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

CurrencyExchange-1.0.3.tar.gz (2.4 kB view details)

Uploaded Source

File details

Details for the file CurrencyExchange-1.0.3.tar.gz.

File metadata

  • Download URL: CurrencyExchange-1.0.3.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

File hashes

Hashes for CurrencyExchange-1.0.3.tar.gz
Algorithm Hash digest
SHA256 c647f5a0509e5ec028dadb774806912931a3e047536b5c80a8f59eb53d8eb7df
MD5 5629b0f15850d5bbdce01d94c76d1b55
BLAKE2b-256 6c93536cb71218b4b7cb46dde105570592f6b48a05b6ac930f495ca66a39748f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page