Skip to content

Forex Class

Forex

Bases: ObjectBase

Represents a currency.

Example
from fmd import FmdApi

fa = FmdApi()
forex = fa.forex.get(currency='TWD')

Attributes:

Name Type Description
currency str

The currency of the forex.

Methods:

Name Description
get_rate

Retrieves the rates for the currency within the specified date range.

get_profile

Retrieves the profile information of the currency.

get_profile()

Retrieves the profile for the currency.

Returns:

Type Description
ForexProfile

A ForexProfile object containing the profile information of the forex.

get_rate(start_date=None, end_date=None)

Retrieves the rates for the currency within the specified date range. Default data range is last 30 days.

Parameters:

Name Type Description Default
start_date str | date | None

The start date for the rates data.

None
end_date str | date | None

The end date for the rates data.

None

Returns:

Type Description
list[ForexRate]

A list of ForexRate objects containing rates information.

ForexManager

Bases: ManagerBase

Manages multiple Forex objects.

Methods:

Name Description
get

Retrieves a Forex object based on the provided currency.

get_available_list

Retrieves a list of available forex with their profiles.

get(currency)

Retrieves a Forex object based on the provided currency.

Parameters:

Name Type Description Default
currency str

The currency of the forex to retrieve.

required

Returns:

Type Description
Forex

A Forex object corresponding to the provided currency.

get_available_list()

Retrieves a list of available currencies with their profiles.

Returns:

Type Description
list[ForexProfile]

A list of ForexProfile objects containing the profile information of available currencies.