Skip to content

Currencies

This is a list of all currencies currently supported by ccy. You can add more by contributing to the currency database.

CodeNameISOCountryOrderRoundingFixed DCFloat DC
AEDUnited Arab Emirates Dirham784AE4104ACT/365ACT/365
ALLAlbanian Lek008AL4132ACT/360ACT/360
AMDArmenian Dram051AM4302ACT/365ACT/365
ARSArgentine Peso032AR301430/360ACT/360
AUDAustralian Dollar036AU34ACT/365ACT/365
AZNAzerbaijani Manat944AZ4252ACT/365ACT/365
BAMBosnia-Herzegovina Mark977BA412230/360ACT/360
BDTBangladeshi Taka050BD5102ACT/365ACT/365
BGNBulgarian Lev975BG4104ACT/365ACT/365
BHDBahraini Dinar048BH553ACT/365ACT/365
BMDBermudian Dollar060BM4104ACT/365ACT/365
BOBBolivian Boliviano068BO3202ACT/360ACT/360
BRLBrazilian Real986BR2004BUS/252BUS/252
BYNBelarusian Ruble933BY4152ACT/ACTACT/ACT
CADCanadian Dollar124CA64ACT/365ACT/365
CHFSwiss Franc756CH7430/360ACT/360
CLPChilean Peso152CL545002ACT/360ACT/360
CNYChinese Renminbi156CN6804ACT/365ACT/365
COPColombian Peso170CO1900002ACT/360ACT/360
CRCCosta Rican Colon188CR3302ACT/360ACT/360
CZKCzech Koruna203CZ284ACT/360ACT/360
DKKDanish Krona208DK10430/360ACT/360
DOPDominican Peso214DO3252ACT/360ACT/360
EGPEgyptian Pound818EG5504ACT/365ACT/365
EUREuro978EU1430/360ACT/360
GBPBritish Pound826GB24ACT/365ACT/365
GELGeorgian Lari981GE4202ACT/365ACT/365
GTQGuatemalan Quetzal320GT3352ACT/360ACT/360
HKDHong Kong Dollar344HK194ACT/365ACT/365
HNLHonduran Lempira340HN3402ACT/360ACT/360
HUFHungarian Forint348HU324ACT/365ACT/360
IDRIndonesian Rupiah360ID9700000ACT/360ACT/360
ILSIsraeli Shekel376IL4104ACT/365ACT/365
INRIndian Rupee356IN45004ACT/365ACT/365
IQDIraqi Dinar368IQ4103ACT/365ACT/365
ISKIcelandic Krona352IS110ACT/365ACT/365
JMDJamaican Dollar388JM4104ACT/360ACT/360
JODJordanian Dinar400JO653ACT/365ACT/365
JPYJapanese Yen392JP100002ACT/365ACT/360
KRWSouth Korean won410KR1100002ACT/365ACT/365
KWDKuwaiti Dinar414KW503ACT/365ACT/365
KZTTenge398KZ4104ACT/365ACT/365
LKRSri Lankan Rupee144LK5202ACT/365ACT/365
MDLMoldovan Leu498MD4142ACT/365ACT/365
MKDNorth Macedonian Denar807MK4162ACT/360ACT/360
MXNMexican Peso484MX13304ACT/360ACT/360
MYRMalaysian Ringgit458MY3454ACT/365ACT/365
NGNNigerian Naira566NG6504ACT/365ACT/365
NIONicaraguan Cordoba558NI3452ACT/360ACT/360
NOKNorwegian Krona578NO8430/360ACT/360
NZDNew-Zealand Dollar554NZ44ACT/365ACT/365
OMROmani Rial512OM603ACT/365ACT/365
PENPeruvian New Sol604PE2204ACT/360ACT/360
PHPPhilippines Peso608PH47704ACT/360ACT/360
PKRPakistani Rupee586PK5002ACT/365ACT/365
PLNPolish Złoty985PL294ACT/ACTACT/365
PYGParaguayan Guarani600PY3150ACT/360ACT/360
QARQatari Riyal634QA4104ACT/365ACT/365
RONRomanian Leu946RO344ACT/360ACT/360
RSDSerbian Dinar941RS4112ACT/360ACT/360
RUBRussian Ruble643RU364ACT/ACTACT/ACT
SARSaudi Riyal682SA4104ACT/365ACT/365
SEKSwedish Krona752SE9430/360ACT/360
SGDSingapore Dollar702SG154ACT/365ACT/365
THBThai Baht764TH33002ACT/365ACT/365
TRYTurkish Lira949TR304ACT/360ACT/360
TTDTrinidad and Tobago Dollar780TT4104ACT/360ACT/360
TWDTaiwan Dollar901TW184ACT/365ACT/365
UAHUkrainian Hryvnia980UA354ACT/ACTACT/ACT
USDUS Dollar840US5030/360ACT/360
UYUUruguayan Peso858UY3102ACT/360ACT/360
VESVenezuelan Bolivar928VE3502ACT/360ACT/360
VNDVietnamese Dong704VN17000000ACT/365ACT/365
XAGSilver961XA-32ACT/365ACT/365
XAUGold959XA-42ACT/365ACT/365
XBTBitcoin000WW-18ACT/365ACT/365
XDRSpecial Drawing Rights960XD-22ACT/365ACT/365
ZARSouth African Rand710ZA7504ACT/365ACT/365

CCY

ccy.core.currency.CCY pydantic-model

Bases: BaseModel

Fields:

code pydantic-field

code

ISO 4217 three-letter currency code

isonumber pydantic-field

isonumber

ISO 4217 numeric code

twoletterscode pydantic-field

twoletterscode

Internal two-letter code

order pydantic-field

order

Default ordering in currency pairs

name pydantic-field

name

Currency name

rounding pydantic-field

rounding

Number of decimal places

default_country pydantic-field

default_country

Default ISO 3166-1 alpha-2 country code

fixeddc pydantic-field

fixeddc = ACT365

Fixed leg day count convention

floatdc pydantic-field

floatdc = ACT365

Float leg day count convention

fixedfreq pydantic-field

fixedfreq = ''

Fixed leg payment frequency

floatfreq pydantic-field

floatfreq = ''

Float leg payment frequency

future pydantic-field

future = ''

Futures contract ticker

symbol_raw pydantic-field

symbol_raw = '\\u00a4'

Raw unicode escape string for the currency symbol

html pydantic-field

html = ''

HTML entity for the currency symbol

symbol property

symbol

Currency symbol decoded from the unicode escape string

description

description()
Source code in ccy/core/currency.py
def description(self) -> str:
    if self.order > usd_order:
        v = "USD / %s" % self.code
    else:
        v = "%s / USD" % self.code
    if self.order != usd_order:
        return "%s Spot Exchange Rate" % v
    else:
        return "Dollar"

info

info()
Source code in ccy/core/currency.py
def info(self) -> dict[str, Any]:
    return self.model_dump()

printinfo

printinfo(stream=None)
Source code in ccy/core/currency.py
def printinfo(self, stream: Any | None = None) -> None:
    info = self.info()
    stream = stream or sys.stdout
    for k, v in info.items():
        stream.write(to_string("%s: %s\n" % (k, v)))

swap

swap(c2)

put the order of currencies as market standard

Source code in ccy/core/currency.py
def swap(self, c2: Self) -> tuple[bool, Self, Self]:
    """
    put the order of currencies as market standard
    """
    inv = False
    c1 = self
    if c1.order > c2.order:
        ct = c1
        c1 = c2
        c2 = ct
        inv = True
    return inv, c1, c2

overusdfunc

overusdfunc()
Source code in ccy/core/currency.py
def overusdfunc(self) -> Callable[[float], float]:
    if self.order > usd_order:
        return overusdfuni
    else:
        return overusdfun

usdoverfunc

usdoverfunc()
Source code in ccy/core/currency.py
def usdoverfunc(self) -> Callable[[float], float]:
    if self.order > usd_order:
        return overusdfun
    else:
        return overusdfuni

as_cross

as_cross(delimiter='')

Return a cross rate representation with respect USD. @param delimiter: could be '' or '/' normally

Source code in ccy/core/currency.py
def as_cross(self, delimiter: str = "") -> str:
    """
    Return a cross rate representation with respect USD.
    @param delimiter: could be '' or '/' normally
    """
    if self.order > usd_order:
        return "USD%s%s" % (delimiter, self.code)
    else:
        return "%s%sUSD" % (self.code, delimiter)

spot

spot(c2, v1, v2)
Source code in ccy/core/currency.py
def spot(self, c2: Self, v1: float, v2: float) -> float:
    if self.order > c2.order:
        vt = v1
        v1 = v2
        v2 = vt
    return v1 / v2