Python library for integrating with the Currency API.
Project description
Python library for integrating with Currency API functionality.
Requirements
Python 2.7 and later.
Setup
You can install this package by using the pip tool and installing:
$ pip install fxdatapi
Or:
$ easy_install fxdatapi
Usage Example
from fxdatapi.auth import Auth
from fxdatapi.currencies import Currencies
from fxdatapi.historical import Historical
from fxdatapi.convert import Convert
from fxdatapi.convert_all import ConvertAll
from fxdatapi.daily_average import DailyAverage
from fxdatapi.weekly_average import WeeklyAverage
from fxdatapi.monthly_average import MonthlyAverage
from fxdatapi.margins_spreads import MarginsSpreads
from fxdatapi.performances import Performances
from fxdatapi.signals import Signals
# Authenticate and log in
auth = Auth()
username = "your_username"
password = "your_password"
result = auth.login(username, password)
print("Login successful:", result)
currencies = Currencies(auth.headers)
result = currencies.get_currencies(username, "19", "04", "2023")
print("Currencies:", result)
uuid = "currency_uuid"
result = currencies.get_currency(uuid, username, "19", "04", "2023")
print("Currency:", result)
historical = Historical(auth.headers)
result = historical.get_historical(username, "2023_04_19", "19", "04", "2023")
print("Historical data:", result)
uuid = "historical_uuid"
result = historical.get_historical_currency(uuid, username, "2023_04_19", "19", "04", "2023")
print("Historical currency:", result)
convert = Convert(auth.headers)
result = convert.convert_currency(username, "2023_04_19", "GBP", "EUR", "500")
print("Converted amount:", result)
convert_all = ConvertAll(auth.headers)
result = convert_all.convert_all_currencies(username, "GBP", 120, "2023_04_19")
print("Converted amounts:", result)
daily_average = DailyAverage(auth.headers)
result = daily_average.get_daily_average("2023_04_19")
print("Daily average:", result)
weekly_average = WeeklyAverage(auth.headers)
result = weekly_average.get_weekly_average("2023_04_03", "2023_04_07")
print("Weekly average:", result)
monthly_average = MonthlyAverage(auth.headers)
result = monthly_average.get_monthly_average("2023", "04")
print("Monthly average:", result)
margins_spreads = MarginsSpreads(auth.headers)
result = margins_spreads.get_margins_spreads(username, "19", "04", "2023")
print("Margins and spreads:", result)
uuid = "margins_spreads_uuid"
result = margins_spreads.get_margins_spreads_currency(uuid, username, "19", "04", "2023")
print("Margins and spreads for currency:", result)
performances = Performances(auth.headers)
result = performances.get_performances(username)
print("Performances:", result)
uuid = "performance_uuid"
result = performances.get_performance(uuid, username)
print("Performance:", result)
signals = Signals(auth.headers)
result = signals.get_signals(username)
print("Signals:", result)
uuid = "signal_uuid"
result = signals.get_signal(uuid, username)
print("Signal:", result)
Setting up Currency API Account
Subscribe here for a user account.
Using the Currency API
You can read the API documentation to understand what’s possible with the Currency API. If you need further assistance, don’t hesitate to contact us.
License
This project is licensed under the BSD 3-Clause License.
Copyright
Copyright © 2020 - 2023 Hori Systems Limited. All Rights Reserved.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fxdatapi-1.1.4.tar.gz
(7.7 kB
view details)
Built Distribution
File details
Details for the file fxdatapi-1.1.4.tar.gz
.
File metadata
- Download URL: fxdatapi-1.1.4.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50487b5fb57741fcabe05572ac6e1493e7d0a62a4ea6960a6a9e4833695cc92a |
|
MD5 | 32338d53c00832d58e550221ea8157bb |
|
BLAKE2b-256 | 9b5307e79d4e1f7745fbfcd01994e4629945a8cb8ebf526c3c31e1141950566c |
File details
Details for the file fxdatapi-1.1.4-py3-none-any.whl
.
File metadata
- Download URL: fxdatapi-1.1.4-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c033b24e38c1fd66640971f1af736177401f6a482133a785ef492fc14b354962 |
|
MD5 | ca2d21390d9a9dfab69fbbb3709e1e54 |
|
BLAKE2b-256 | 67f02612d1387db7c03e81489cd7a48c8591365c8bf9d73fdebab008126917d8 |