Skip to content

Python CCY

Getting Started

  • installation
    pip install ccy
    
  • display currencies
import ccy
import pandas as pd
df = pd.DataFrame(ccy.dump_currency_table())
df.head(80)

Main Usage

import ccy
eur = ccy.currency("aud")
eur.printinfo()

A currency is represented by the CCY class. See the Currencies page for the full field reference.

Currency Crosses

You can create currency pairs by using the currency_pair function:

c = ccy.currency_pair("eurusd")
c
c.mkt()
c = ccy.currency_pair("chfusd")
c.mkt()  # market convention pair

cross & crossover

Some shortcuts:

ccy.cross("aud")
ccy.crossover('eur')
ccy.crossover('chf')
ccy.crossover('aud')

Note, the Swiss franc cross is represented as 'USD/CHF', while the Aussie Dollar and Euro crosses are represented with the USD as denominator. This is the market convention which is handled by the order property of a currency object.

Eurozone

The euro area, commonly called the eurozone (EZ), is a currency union of 20 member states of the European Union (EU) that have adopted the euro (€) as their primary currency and sole legal tender, and have thus fully implemented EMU policies.

ccy.eurozone
ccy.print_eurozone()