Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

License

NotificationsYou must be signed in to change notification settings

brunobcardoso/pyptax

Repository files navigation

PyPtax is a Python library and CLI to retrieve information onPtax rates

Latest VersionBuild StatusCoverageSupported VersionsDocumentation StatusCode Style

Features |Installation |Quickstart |Documentation |Contributing

What is Ptax?

Ptax exchange rateis the reference exchange rate for U.S. Dollar, expressed as the amount of Brazilian Reais per one U.S. Dollar,published by theCentral 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.bid4.1823>>> bulletin.ask4.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_bulletinHistoricalBulletin(    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"        },    ],}

⚠️ Enter all dates in the formatYYYY-MM-DD

Documentation

The full documentation is available onhttps://pyptax.readthedocs.io/.

Contributing

Please see thecontributing pagefor guidance on setting up a development environment and how to contribute.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp