Skip to main content

Xecd Rates Python: Free currency rates converter

Project description

image


Xecd Rates Python: Free currency rates converter

made-with-python PyPI Latest Release PyPI license PyPI format PyPI pyversions

What is it?

This project is free version of XE Currency Data (XECD) product.

Xecd-Rates-Python librariy gives you access to daily or live rates and historic mid-market conversion rates between all of our supported currencies.

You can access the paid version of this project via this link.

Where to get it

The preferred way to install this package is pip.

pip install xecd-rates

Or get the latest version from git:

pip install git+https://github.com/doguskidik/xecd-rates-python.git

Dependencies

Usage

>>> from xecd_rates import Xecd
>>> xecd = Xecd()

>>> xecd.available_currencies
{'AFN': 'Afghan Afghani', 'ALL': 'Albanian Lek', 'AMD': 'Armenian Dram', 'ANG': 'Dutch Guilder', 'AOA': 'Angolan Kwanza', 'ARS': 'Argentine Peso', 'AUD': 'Australian Dollar', 'AWG': 'Aruban or Dutch Guilder', 'AZN': 'Azerbaijan Manat', 'BAM': 'Bosnian Convertible Mark', 'BBD': 'Barbadian or Bajan Dollar', 'BDT': 'Bangladeshi Taka', 'BGN': 'Bulgarian Lev', 'BHD': 'Bahraini Dinar', 'BIF': 'Burundian Franc', 'BMD': 'Bermudian Dollar', 'BND': 'Bruneian Dollar', 'BOB': 'Bolivian Bolíviano', 'BRL': 'Brazilian Real', 'BSD': 'Bahamian Dollar', 'BTN': 'Bhutanese Ngultrum', 'BWP': 'Botswana Pula', 'BYN': 'Belarusian Ruble', 'BZD': 'Belizean Dollar', 'CAD': 'Canadian Dollar', 'CDF': 'Congolese Franc', 'CHF': 'Swiss Franc', 'CLP': 'Chilean Peso', 'CNY': 'Chinese Yuan Renminbi', 'COP': 'Colombian Peso', 'CRC': 'Costa Rican Colon', 'CUC': 'Cuban Convertible Peso', 'CUP': 'Cuban Peso', 'CVE': 'Cape Verdean Escudo', 'CZK': 'Czech Koruna', 'DJF': 'Djiboutian Franc', 'DKK': 'Danish Krone', 'DOP': 'Dominican Peso', 'DZD': 'Algerian Dinar', 'EGP': 'Egyptian Pound', 'ERN': 'Eritrean Nakfa', 'ETB': 'Ethiopian Birr', 'EUR': 'Euro', 'FJD': 'Fijian Dollar', 'FKP': 'Falkland Island Pound', 'GBP': 'British Pound', 'GEL': 'Georgian Lari', 'GGP': 'Guernsey Pound', 'GHS': 'Ghanaian Cedi', 'GIP': 'Gibraltar Pound', 'GMD': 'Gambian Dalasi', 'GNF': 'Guinean Franc', 'GTQ': 'Guatemalan Quetzal', 'GYD': 'Guyanese Dollar', 'HKD': 'Hong Kong Dollar', 'HNL': 'Honduran Lempira', 'HRK': 'Croatian Kuna', 'HTG': 'Haitian Gourde', 'HUF': 'Hungarian Forint', 'IDR': 'Indonesian Rupiah', 'ILS': 'Israeli Shekel', 'IMP': 'Isle of Man Pound', 'INR': 'Indian Rupee', 'IQD': 'Iraqi Dinar', 'IRR': 'Iranian Rial', 'ISK': 'Icelandic Krona', 'JEP': 'Jersey Pound', 'JMD': 'Jamaican Dollar', 'JOD': 'Jordanian Dinar', 'JPY': 'Japanese Yen', 'KES': 'Kenyan Shilling', 'KGS': 'Kyrgyzstani Som', 'KHR': 'Cambodian Riel', 'KMF': 'Comorian Franc', 'KPW': 'North Korean Won', 'KRW': 'South Korean Won', 'KWD': 'Kuwaiti Dinar', 'KYD': 'Caymanian Dollar', 'KZT': 'Kazakhstani Tenge', 'LAK': 'Lao Kip', 'LBP': 'Lebanese Pound', 'LKR': 'Sri Lankan Rupee', 'LRD': 'Liberian Dollar', 'LSL': 'Basotho Loti', 'LYD': 'Libyan Dinar', 'MAD': 'Moroccan Dirham', 'MDL': 'Moldovan Leu', 'MGA': 'Malagasy Ariary', 'MKD': 'Macedonian Denar', 'MMK': 'Burmese Kyat', 'MNT': 'Mongolian Tughrik', 'MOP': 'Macau Pataca', 'MRU': 'Mauritanian Ouguiya', 'MUR': 'Mauritian Rupee', 'MVR': 'Maldivian Rufiyaa', 'MWK': 'Malawian Kwacha', 'MXN': 'Mexican Peso', 'MYR': 'Malaysian Ringgit', 'MZN': 'Mozambican Metical', 'NAD': 'Namibian Dollar', 'NGN': 'Nigerian Naira', 'NIO': 'Nicaraguan Cordoba', 'NOK': 'Norwegian Krone', 'NPR': 'Nepalese Rupee', 'NZD': 'New Zealand Dollar', 'OMR': 'Omani Rial', 'PAB': 'Panamanian Balboa', 'PEN': 'Peruvian Sol', 'PGK': 'Papua New Guinean Kina', 'PHP': 'Philippine Peso', 'PKR': 'Pakistani Rupee', 'PLN': 'Polish Zloty', 'PYG': 'Paraguayan Guarani', 'QAR': 'Qatari Riyal', 'RON': 'Romanian Leu', 'RSD': 'Serbian Dinar', 'RUB': 'Russian Ruble', 'RWF': 'Rwandan Franc', 'SAR': 'Saudi Arabian Riyal', 'SBD': 'Solomon Islander Dollar', 'SCR': 'Seychellois Rupee', 'SDG': 'Sudanese Pound', 'SEK': 'Swedish Krona', 'SGD': 'Singapore Dollar', 'SHP': 'Saint Helenian Pound', 'SLL': 'Sierra Leonean Leone', 'SOS': 'Somali Shilling', 'SPL': 'Seborgan Luigino', 'SRD': 'Surinamese Dollar', 'STN': 'Sao Tomean Dobra', 'SVC': 'Salvadoran Colon', 'SYP': 'Syrian Pound', 'SZL': 'Swazi Lilangeni', 'THB': 'Thai Baht', 'TJS': 'Tajikistani Somoni', 'TMT': 'Turkmenistani Manat', 'TND': 'Tunisian Dinar', 'TOP': "Tongan Pa'anga", 'TRY': 'Turkish Lira', 'TTD': 'Trinidadian Dollar', 'TVD': 'Tuvaluan Dollar', 'TWD': 'Taiwan New Dollar', 'TZS': 'Tanzanian Shilling', 'UAH': 'Ukrainian Hryvnia', 'UGX': 'Ugandan Shilling', 'USD': 'US Dollar', 'UYU': 'Uruguayan Peso', 'UZS': 'Uzbekistani Som', 'VEF': 'Venezuelan Bolívar', 'VES': 'Venezuelan Bolívar', 'VND': 'Vietnamese Dong', 'VUV': 'Ni', 'WST': 'Samoan Tala', 'XAF': 'Central African CFA Franc BEAC', 'XAG': 'Silver Ounce', 'XAU': 'Gold Ounce', 'XBT': 'Bitcoin', 'XCD': 'East Caribbean Dollar', 'XDR': 'IMF Special Drawing Rights', 'XOF': 'CFA Franc', 'XPD': 'Palladium Ounce', 'XPF': 'CFP Franc', 'XPT': 'Platinum Ounce', 'YER': 'Yemeni Rial', 'ZAR': 'South African Rand'}

>>> xecd.convert_from(cfrom='TRY', cto=['EUR','USD']) 
{'timestamp': '2020-06-29 12:38 UTC', 'from': 'TRY', 'to': [{'quotecurrency': 'USD', 'mid': '0.1458731540'}, {'quotecurrency': 'EUR', 'mid': '0.1293255181'}]}

>>> xecd.historic_rate(cdate='2020-01-01', cfrom='TRY', cto=['EUR','USD']) 
{'timestamp': '2020-01-01 17:00 UTC', 'from': 'TRY', 'to': [{'quotecurrency': 'USD', 'mid': '0.1681044260'}, {'quotecurrency': 'EUR', 'mid': '0.1501472598'}]}

>>> xecd.historic_rate_period(sdate='2020-01-01', edate='2020-01-05', cfrom='TRY', cto=['EUR','USD'])
{'from': 'TRY', 'to': {'USD': [{'mid': '0.1678214515', 'timestamp': '2020-01-02 17:00 UTC'}, {'mid': '0.1673405691', 'timestamp': '2020-01-03 17:00 UTC'}, {'mid': '0.1673821113', 'timestamp': '2020-01-04 17:00 UTC'}, {'mid': '0.1673821113', 'timestamp': '2020-01-04 17:00 UTC'}, {'mid': '0.1674115622', 'timestamp': '2020-01-05 17:00 UTC'}], 'EUR': [{'mid': '0.1502682495', 'timestamp': '2020-01-02 17:00 UTC'}, {'mid': '0.1497847442', 'timestamp': '2020-01-03 17:00 UTC'}, {'mid': '0.1499997714', 'timestamp': '2020-01-04 17:00 UTC'}, {'mid': '0.1499997714', 'timestamp': '2020-01-04 17:00 UTC'}, {'mid': '0.1499838691', 'timestamp': '2020-01-05 17:00 UTC'}]}}

Available Currencies

Currency Code Description
AFN Afghan Afghani
ALL Albanian Lek
AMD Armenian Dram
ANG Dutch Guilder
AOA Angolan Kwanza
ARS Argentine Peso
AUD Australian Dollar
AWG Aruban or Dutch Guilder
AZN Azerbaijan Manat
BAM Bosnian Convertible Mark
BBD Barbadian or Bajan Dollar
BDT Bangladeshi Taka
BGN Bulgarian Lev
BHD Bahraini Dinar
BIF Burundian Franc
BMD Bermudian Dollar
BND Bruneian Dollar
BOB Bolivian Bolíviano
BRL Brazilian Real
BSD Bahamian Dollar
BTN Bhutanese Ngultrum
BWP Botswana Pula
BYN Belarusian Ruble
BZD Belizean Dollar
CAD Canadian Dollar
CDF Congolese Franc
CHF Swiss Franc
CLP Chilean Peso
CNY Chinese Yuan Renminbi
COP Colombian Peso
CRC Costa Rican Colon
CUC Cuban Convertible Peso
CUP Cuban Peso
CVE Cape Verdean Escudo
CZK Czech Koruna
DJF Djiboutian Franc
DKK Danish Krone
DOP Dominican Peso
DZD Algerian Dinar
EGP Egyptian Pound
ERN Eritrean Nakfa
ETB Ethiopian Birr
EUR Euro
FJD Fijian Dollar
FKP Falkland Island Pound
GBP British Pound
GEL Georgian Lari
GGP Guernsey Pound
GHS Ghanaian Cedi
GIP Gibraltar Pound
GMD Gambian Dalasi
GNF Guinean Franc
GTQ Guatemalan Quetzal
GYD Guyanese Dollar
HKD Hong Kong Dollar
HNL Honduran Lempira
HRK Croatian Kuna
HTG Haitian Gourde
HUF Hungarian Forint
IDR Indonesian Rupiah
ILS Israeli Shekel
IMP Isle of Man Pound
INR Indian Rupee
IQD Iraqi Dinar
IRR Iranian Rial
ISK Icelandic Krona
JEP Jersey Pound
JMD Jamaican Dollar
JOD Jordanian Dinar
JPY Japanese Yen
KES Kenyan Shilling
KGS Kyrgyzstani Som
KHR Cambodian Riel
KMF Comorian Franc
KPW North Korean Won
KRW South Korean Won
KWD Kuwaiti Dinar
KYD Caymanian Dollar
KZT Kazakhstani Tenge
LAK Lao Kip
LBP Lebanese Pound
LKR Sri Lankan Rupee
LRD Liberian Dollar
LSL Basotho Loti
LYD Libyan Dinar
MAD Moroccan Dirham
MDL Moldovan Leu
MGA Malagasy Ariary
MKD Macedonian Denar
MMK Burmese Kyat
MNT Mongolian Tughrik
MOP Macau Pataca
MRU Mauritanian Ouguiya
MUR Mauritian Rupee
MVR Maldivian Rufiyaa
MWK Malawian Kwacha
MXN Mexican Peso
MYR Malaysian Ringgit
MZN Mozambican Metical
NAD Namibian Dollar
NGN Nigerian Naira
NIO Nicaraguan Cordoba
NOK Norwegian Krone
NPR Nepalese Rupee
NZD New Zealand Dollar
OMR Omani Rial
PAB Panamanian Balboa
PEN Peruvian Sol
PGK Papua New Guinean Kina
PHP Philippine Peso
PKR Pakistani Rupee
PLN Polish Zloty
PYG Paraguayan Guarani
QAR Qatari Riyal
RON Romanian Leu
RSD Serbian Dinar
RUB Russian Ruble
RWF Rwandan Franc
SAR Saudi Arabian Riyal
SBD Solomon Islander Dollar
SCR Seychellois Rupee
SDG Sudanese Pound
SEK Swedish Krona
SGD Singapore Dollar
SHP Saint Helenian Pound
SLL Sierra Leonean Leone
SOS Somali Shilling
SPL Seborgan Luigino
SRD Surinamese Dollar
STN Sao Tomean Dobra
SVC Salvadoran Colon
SYP Syrian Pound
SZL Swazi Lilangeni
THB Thai Baht
TJS Tajikistani Somoni
TMT Turkmenistani Manat
TND Tunisian Dinar
TOP Tongan Pa'anga
TRY Turkish Lira
TTD Trinidadian Dollar
TVD Tuvaluan Dollar
TWD Taiwan New Dollar
TZS Tanzanian Shilling
UAH Ukrainian Hryvnia
UGX Ugandan Shilling
USD US Dollar
UYU Uruguayan Peso
UZS Uzbekistani Som
VEF Venezuelan Bolívar
VES Venezuelan Bolívar
VND Vietnamese Dong
VUV Ni
WST Samoan Tala
XAF Central African CFA Franc BEAC
XAG Silver Ounce
XAU Gold Ounce
XBT Bitcoin
XCD East Caribbean Dollar
XDR IMF Special Drawing Rights
XOF CFA Franc
XPD Palladium Ounce
XPF CFP Franc
XPT Platinum Ounce
YER Yemeni Rial
ZAR South African Rand

Contributing

xecd_rates_python is an open-source project. Submit a pull request to contribute!

Testing

to run individual test suites

python -m unittest tests/test_integration.py

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

xecd_rates-1.0.2.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

xecd_rates-1.0.2-py2.py3-none-any.whl (10.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file xecd_rates-1.0.2.tar.gz.

File metadata

  • Download URL: xecd_rates-1.0.2.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3

File hashes

Hashes for xecd_rates-1.0.2.tar.gz
Algorithm Hash digest
SHA256 390d7729a61e3e1e0bf49045eb7785dd6e9f275f28222f8c5e5c04450ea34c8f
MD5 3ae661c55f258be2afead57a41473544
BLAKE2b-256 ccab4fb995dbaf6df3f438bb785be43454fd5a9ce93193822582e3325510336e

See more details on using hashes here.

File details

Details for the file xecd_rates-1.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: xecd_rates-1.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3

File hashes

Hashes for xecd_rates-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c1b9b1c10e5f4855aa9dba4f40ed02995cad8db9db3308da890091ed3913b8c0
MD5 a791be2f5b2eb67bf8ecfd07ca227477
BLAKE2b-256 d7516cb04798f54ae00fa94b1ade4c7c068fa6fdb5989fcbcc75c0bb8c55e963

See more details on using hashes here.

Supported by

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