Name | bnrxrate JSON |
Version |
0.1.1
JSON |
| download |
home_page | None |
Summary | A Python library for fetching and processing XML data from BNR (National Bank of Romania) website |
upload_time | 2024-06-16 14:31:06 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3 |
license | MIT License |
keywords |
bnr
exchange rates
xml
python
bank
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# bnrxrate
Python3 utility for easily accessing and parsing XML documents containing the exchange rates published by BNR (Romanian National Bank / Banca Națională a României) on their website.
## Features
- Fetch XML documents from https://www.bnr.ro with simple function calls.
- Parse XML into a Pythonic format (a dict).
- Cache retrieved data in an object property (a dict).
## Installation
`pip install bnrxrate`
## Usage
```
from bnrxrate import Xrates
bnrxr = Xrates()
# Get the listed exchange rates for all symbols for today:
bnrxr.get_xrate()
# Get the exchange rate for EUR and USD for today:
bnrxr.get_xrate(['EUR', 'USD'])
# Get the exchange rate for EUR and USD for specific date:
date = datetime.date(2024, 2, 22)
bnrxr.get_xrate(['EUR', 'USD'], date)
# Get the symbols available at a specific date:
date = datetime.date(2024, 6, 1)
bnrxr.list_symbols(date)
# Get the exchange rates for all symbols in a specific period:
start_date = datetime.date(2024, 1, 1)
end_date = datetime.date.today()
all_xrates = bnrxr.get_xrate([], start_date, end_date)
# Get the exchange rates for specific symbols in a specific period:
start_date = datetime.date(2024, 1, 1)
end_date = datetime.date.today()
all_xrates = bnrxr.get_xrate(['EUR', 'usd'], start_date, end_date)
# Check if a specific date is a banking day:
date = datetime.date(2024, 4, 1)
bnrxr.is_banking_day(date)
```
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "bnrxrate",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3",
"maintainer_email": null,
"keywords": "bnr, exchange rates, XML, python, bank",
"author": null,
"author_email": "Marian Bureata <code@bureata.com>",
"download_url": "https://files.pythonhosted.org/packages/c2/92/d8df27b27163a3937b6752ba9862249ee0b0b909a95e0d07200d3eb0e57f/bnrxrate-0.1.1.tar.gz",
"platform": null,
"description": "# bnrxrate\n\nPython3 utility for easily accessing and parsing XML documents containing the exchange rates published by BNR (Romanian National Bank / Banca Na\u021bional\u0103 a Rom\u00e2niei) on their website.\n\n## Features\n\n- Fetch XML documents from https://www.bnr.ro with simple function calls.\n- Parse XML into a Pythonic format (a dict).\n- Cache retrieved data in an object property (a dict).\n\n## Installation\n`pip install bnrxrate`\n\n## Usage\n\n```\nfrom bnrxrate import Xrates\n\nbnrxr = Xrates()\n\n# Get the listed exchange rates for all symbols for today:\nbnrxr.get_xrate()\n\n# Get the exchange rate for EUR and USD for today:\nbnrxr.get_xrate(['EUR', 'USD'])\n\n# Get the exchange rate for EUR and USD for specific date:\ndate = datetime.date(2024, 2, 22)\nbnrxr.get_xrate(['EUR', 'USD'], date)\n\n# Get the symbols available at a specific date:\ndate = datetime.date(2024, 6, 1)\nbnrxr.list_symbols(date)\n\n# Get the exchange rates for all symbols in a specific period:\nstart_date = datetime.date(2024, 1, 1)\nend_date = datetime.date.today()\nall_xrates = bnrxr.get_xrate([], start_date, end_date)\n\n# Get the exchange rates for specific symbols in a specific period:\nstart_date = datetime.date(2024, 1, 1)\nend_date = datetime.date.today()\nall_xrates = bnrxr.get_xrate(['EUR', 'usd'], start_date, end_date)\n\n# Check if a specific date is a banking day:\ndate = datetime.date(2024, 4, 1)\nbnrxr.is_banking_day(date)\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "A Python library for fetching and processing XML data from BNR (National Bank of Romania) website",
"version": "0.1.1",
"project_urls": {
"documentation": "https://github.com/bureata/bnrxrate#readme",
"homepage": "https://github.com/bureata/bnrxrate",
"repository": "https://github.com/bureata/bnrxrate"
},
"split_keywords": [
"bnr",
" exchange rates",
" xml",
" python",
" bank"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "10b418a4fbef6cad71a42a39ab9d43bf29df1d932862e543e6a2cecada99be70",
"md5": "00defc1ecdbb2a2bd22a286adabd6a72",
"sha256": "556fb5477da092c9023738f964c173293e8b4be83484d75574d985fcfd06cc19"
},
"downloads": -1,
"filename": "bnrxrate-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "00defc1ecdbb2a2bd22a286adabd6a72",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 6729,
"upload_time": "2024-06-16T14:31:05",
"upload_time_iso_8601": "2024-06-16T14:31:05.984357Z",
"url": "https://files.pythonhosted.org/packages/10/b4/18a4fbef6cad71a42a39ab9d43bf29df1d932862e543e6a2cecada99be70/bnrxrate-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c292d8df27b27163a3937b6752ba9862249ee0b0b909a95e0d07200d3eb0e57f",
"md5": "8ca6a88d602c41026807c3b72223a1d1",
"sha256": "0ac136c4f15e800ef9337a70b281bb74d78e19f1d7accfe5e0025b89348bea42"
},
"downloads": -1,
"filename": "bnrxrate-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "8ca6a88d602c41026807c3b72223a1d1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 6058,
"upload_time": "2024-06-16T14:31:06",
"upload_time_iso_8601": "2024-06-16T14:31:06.934295Z",
"url": "https://files.pythonhosted.org/packages/c2/92/d8df27b27163a3937b6752ba9862249ee0b0b909a95e0d07200d3eb0e57f/bnrxrate-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-16 14:31:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bureata",
"github_project": "bnrxrate#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "bnrxrate"
}