Skip to main content

A package that facilitates requests and has some tools for the El-Toque API

Project description

PyToque Class

Class with methods to make requests to the ElToque API (Cuba).

How to use

Primero necesitaras solicitar un token personal desde el sitio de ElToque.

Explanation

https://eltoque.com/eltoque-abre-acceso-a-su-api-de-las-tasas-de-cambio

Form to obtain token

https://tasas-token.eltoque.com/

Open your virtual environment and install dependencies

Create Virtual Environment

python -m venv .venv   

If you use Linux remember to use python3


Activate Virtual Environment

Linux

source .venv/bin/activate

Windows

.venv\Scripts\activate

Install Dependencies

pip install -r requirements.txt

Import the PyToque class and initialize it by sending the api_key obtained on the official ElToque site as a parameter.

Warning Remember to be careful with the privacy of your personal token.

from pytoque.pytoque.core import PyToque

toque = PyToque(api_key=API_KEY)

Docs

get_today() -> dict

Returns the exchange rates for the current date.

Additional Params

  • filters: List of strings with exchange rate abbreviations

Available filters: ['ECU', 'TRX', 'USDT_TRC20', 'BTC', 'BNB', 'USD', 'MLC']

Exceptions

  • Exception('Incorrect Filters') If filters are not available
  • Exception(f'The response was not satisfactory, HTTP STATUS: {response.status_code}') In case the API returns another status code, check the eltoque api documentation to see more.
  • RequestException() In case a failure occurs in the request

get_date(date: str) -> dict

Date parameter in format (YYYY-MM-DD)

Returns the exchange rates of the given date.

Additional Params

  • filters: List of strings with exchange rate abbreviations

Available filters: ['ECU', 'TRX', 'USDT_TRC20', 'BTC', 'BNB', 'USD', 'MLC']

Exceptions

  • Exception('Incorrect Filters') If filters are not available
  • Exception(f'The response was not satisfactory, HTTP STATUS: {response.status_code}') In case the API returns another status code, check the eltoque api documentation to see more.
  • RequestException() In case a failure occurs in the request
  • Exception('Please provide a date in format "YYYY-MM-DD"') In case a bad date format is sent

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

pytoque-0.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytoque-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file pytoque-0.1.0.tar.gz.

File metadata

  • Download URL: pytoque-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pytoque-0.1.0.tar.gz
Algorithm Hash digest
SHA256 98f009b76a97944319c32310a19f611aa8c242285920f6b69013840be7312915
MD5 d2d2a1268fe08590eecaf8a35ce60c0d
BLAKE2b-256 9034310298ab7617d1453ba7d2413c5a96f6ed24bfb9d7ef0a812bb3da1b6b65

See more details on using hashes here.

File details

Details for the file pytoque-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pytoque-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pytoque-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5219278b991dd3f7cef6cce68df3d09c25b3a88ee212c7131af419f92932d9e0
MD5 1f66114e7c61d882b8ab35a3e3f31d7b
BLAKE2b-256 b66bc06e9b6982b1cd87a384ce91faf182c39b0b77c1ad87ecdce3a14d46ea00

See more details on using hashes here.

Supported by

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