Skip to main content

Complete solution for extracting currency pair quotes data. With comprehensive testing, parameter validation, flexible configuration management, Hexagonal Architecture, CI/CD pipelines, code quality tools, and detailed documentation.

Project description

currency-quote-wrapper: Complete solution for extracting currency pair quotes data.

Project description

Complete solution for extracting currency pair quotes data. With comprehensive testing, parameter validation, flexible configuration management, Hexagonal Architecture, CI/CD pipelines, code quality tools, and detailed documentation.

PyPI - Status

PyPI - Downloads

PyPI - Version

PyPI - Python Version

CI CD

Codecov

Project Stack

Python  Docker  Poetry  GitHub Actions  CodeCov  pypi  pandas  pytest 

Project Highlights:

  • Comprehensive Testing: Development of tests to ensure the quality and robustness of the code

  • Parameter Validation: Sending valid parameters based on the request data source itself, ensuring the integrity and accuracy of the information processed.

  • Configuration Management: Use of a configuration module to manage endpoints, retry times and number of attempts, providing flexibility and ease of adjustment.

  • Hexagonal Architecture: Adoption of Hexagonal Architecture to decouple the core logic from external dependencies, ensuring that any current data source can be replaced seamlessly in case of unavailability. This is facilitated by the use of adapters, which act as intermediaries between the core application and the external services.

  • Cotinuous Integration and Continuous Deployment: Use of CI/CD pipelines to automate the build, test and deployment processes, ensuring that the application is always up to date and ready for use.

  • Code Quality: Use of code quality tools such as linters and formatters to ensure that the codebase is clean, consistent and easy to read.

  • Documentation: Creation of detailed documentation to facilitate the understanding and use of the application, including installation instructions, usage examples and troubleshooting guides.

Contributing

See the following docs:

How to get currency quotes using this library

## Importing library
from currency_quote import ClientBuilder

# For get the last quote of one currency
client = ClientBuilder(currency_list="USD-BRL")
# or get quotes of multiple currencies
client = ClientBuilder(currency_list=['USD-BRL', 'EUR-BRL'])

# Get the last quote
print(client.get_last_quote())
# Get history quote of currency
print(client.get_history_quote(reference_date=20220101))
  • This is expected payload for get Last Quote with USD-BRL currency pair
[
   {
      "currency_pair":"USD-BRL",
      "currency_pair_name":"Dólar Americano/Real Brasileiro",
      "base_currency_code":"USD",
      "quote_currency_code":"BRL",
      "quote_timestamp":1727201744,
      "bid_price":"5.4579",
      "ask_price":"5.4589",
      "quote_extracted_at":1727201753
   }
]
  • This is expected payload for get History Quote with USD-BRL currency pair
[
   {
      "currency_pair":"USD-BRL",
      "currency_pair_name":"Dólar Americano/Real Brasileiro",
      "base_currency_code":"USD",
      "quote_currency_code":"BRL",
      "quote_timestamp":1719440767,
      "bid_price":5.524,
      "ask_price":5.5245,
      "quote_extracted_at":1727201753
   }
]
  • This is expected payload for get last Quote with two or more currencies
[
   {
      "currency_pair":"USD-BRL",
      "currency_pair_name":"Dólar Americano/Real Brasileiro",
      "base_currency_code":"USD",
      "quote_currency_code":"BRL",
      "quote_timestamp":1727201384,
      "bid_price":"5.4594",
      "ask_price":"5.4599",
      "quote_extracted_at":1727201387
   },
   {
      "currency_pair":"USD-EUR",
      "currency_pair_name":"Dólar Americano/Euro",
      "base_currency_code":"USD",
      "quote_currency_code":"EUR",
      "quote_timestamp":1727201376,
      "bid_price":"0.8957",
      "ask_price":"0.8958",
      "quote_extracted_at":1727201387
   }
]
  • This is expected payload for history last Quote with two or more currencies
[
   {
      "currency_pair":"USD-BRL",
      "currency_pair_name":"Dólar Americano/Real Brasileiro",
      "base_currency_code":"USD",
      "quote_currency_code":"BRL",
      "quote_timestamp":1727201384,
      "bid_price":"5.4594",
      "ask_price":"5.4599",
      "quote_extracted_at":1727201387
   },
   {
      "currency_pair":"USD-EUR",
      "currency_pair_name":"Dólar Americano/Euro",
      "base_currency_code":"USD",
      "quote_currency_code":"EUR",
      "quote_timestamp":1727201376,
      "bid_price":"0.8957",
      "ask_price":"0.8958",
      "quote_extracted_at":1727201387
   }
]

Hexagonal Design of library

Arch

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

currency_quote-4.2.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

currency_quote-4.2.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file currency_quote-4.2.0.tar.gz.

File metadata

  • Download URL: currency_quote-4.2.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.21 Linux/6.8.0-1021-azure

File hashes

Hashes for currency_quote-4.2.0.tar.gz
Algorithm Hash digest
SHA256 e67301760bb687921ae497d0a4cd83ab82703d9a4d4a07b1879887dbc1fbf514
MD5 9062aa2e22a4af4c064a3fb38044fb0b
BLAKE2b-256 56e57e98e8f21e2c3f42fae4059010e6dbd3030a65a2a87a9a7bf400fec89673

See more details on using hashes here.

File details

Details for the file currency_quote-4.2.0-py3-none-any.whl.

File metadata

  • Download URL: currency_quote-4.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.21 Linux/6.8.0-1021-azure

File hashes

Hashes for currency_quote-4.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a55f4c3518ffa7028cda5dde38fc33618e7eff7c515a24a2004b079da96a072
MD5 d1cd2c5706ddf3708d4437cc0190bdf0
BLAKE2b-256 db465390863cacf8ec0776dc88eabb25d63dac0fe16f26d635fc231f2df625c5

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