Skip to main content

A Python library to retrieve information on Ptax rates

Project description

PyPtax

PyPtax is a Python library and CLI to retrieve information on Ptax rates

Latest Version Build Status Coverage Supported Versions Documentation Status Code Style

Features | Installation | Quickstart | Documentation | Contributing

What is Ptax?

Ptax exchange rate is the reference exchange rate for U.S. Dollar, expressed as the amount of Brazilian Reais per one U.S. Dollar, published by the Central Bank of Brazil.

Features

  • Closing Ptax rates for a requested date
  • Historical Ptax rates for a requested period
  • Intermediary Ptax rates for a requested date

Installation

$ pip install pyptax

Quickstart

Closing Ptax rates for a requested date

Command line:

$ pyptax close --date 2020-01-20

Module:

>>> from pyptax import ptax
>>> bulletin = ptax.close("2020-01-20")
>>> bulletin.as_dict
{
    "datetime": "2020-01-20 13:09:02.871",
    "bid": 4.1823,
    "ask": 4.1829,
    "bulletin_type":
    "close"
}
>>> bulletin.datetime
"2020-01-20 13:09:02.871"
>>> bulletin.bid
4.1823
>>> bulletin.ask
4.1829

Historical Ptax rates for a requested period

Command line:

$ pyptax historical --start_date 2020-01-01 --end_date 2020-01-05

Module:

>>> from pyptax import ptax
>>> historical_bulletin = ptax.historical('2020-01-01', '2020-01-05')
>>> historical_bulletin
HistoricalBulletin(
    start_date="2020-01-01",
    end_date="2020-01-03",
    bulletins=[
        Bulletin("2020-01-02 13:11:10.762", 4.0207, 4.0213, "close"),
        Bulletin("2020-01-03 13:06:22.606", 4.0516, 4.0522, "close"),
    ],
)

>>> historical_bulletin.as_dict
{
    "start_date": "2020-01-01",
    "end_date": "2020-01-03",
    "bulletins": [
        {
            "datetime": "2020-01-02 13:11:10.762",
            "bid": 4.0207,
            "ask": 4.0213,
            "bulletin_type": "close"
        },
        {
            "datetime": "2020-01-03 13:06:22.606",
            "bid": 4.0516,
            "ask": 4.0522,
            "bulletin_type": "close"
        },
    ],
}

:warning: Enter all dates in the format YYYY-MM-DD

Documentation

The full documentation is available on https://pyptax.readthedocs.io/.

Contributing

Please see the contributing page for guidance on setting up a development environment and how to contribute.

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

pyptax-0.5.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

pyptax-0.5.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file pyptax-0.5.0.tar.gz.

File metadata

  • Download URL: pyptax-0.5.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.1

File hashes

Hashes for pyptax-0.5.0.tar.gz
Algorithm Hash digest
SHA256 9f1c006cda1de3fe04529a115cc10e5bbb3e97a43729ffcfbe282cd23da62077
MD5 bdb2f579d1f9204aca39354077b992d3
BLAKE2b-256 687b574645d8a492d5a829b0ca238cdfb111e906f7b37d3739ff5ca631980728

See more details on using hashes here.

File details

Details for the file pyptax-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pyptax-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.1

File hashes

Hashes for pyptax-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c806593cad0533eb428d5c22a4de0902220c70fba29a585e181436b1fa6a043
MD5 9913d54fcdb2d755b8fe4c2cc6183deb
BLAKE2b-256 52778327cc0a5f6f9d438c196d286f1a61fc16372fbfbb5266a1e2c5911a68c7

See more details on using hashes here.

Supported by

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