{"id":15657807,"url":"https://github.com/pythonicninja/nbp_rates","last_synced_at":"2025-03-30T02:21:51.654Z","repository":{"id":163544624,"uuid":"616434902","full_name":"PythonicNinja/nbp_rates","owner":"PythonicNinja","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-10T07:42:33.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-05T04:46:13.583Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PythonicNinja.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-20T11:39:29.000Z","updated_at":"2023-05-10T14:46:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"9917e250-71f7-4ae2-a3a4-621f395a3324","html_url":"https://github.com/PythonicNinja/nbp_rates","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PythonicNinja%2Fnbp_rates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PythonicNinja%2Fnbp_rates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PythonicNinja%2Fnbp_rates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PythonicNinja%2Fnbp_rates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PythonicNinja","download_url":"https://codeload.github.com/PythonicNinja/nbp_rates/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246266582,"owners_count":20749817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T13:09:50.204Z","updated_at":"2025-03-30T02:21:51.636Z","avatar_url":"https://github.com/PythonicNinja.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nbp_rates\n\n[![Python package](https://github.com/PythonicNinja/nbp_rates/actions/workflows/python-package.yml/badge.svg)](https://github.com/PythonicNinja/nbp_rates/actions/workflows/python-package.yml)\n\nUtility for getting exchange rates from multiple backends.\n\nSupported backends:\n- Revolut\n- Walutomat\n- NBP (Narodowy Bank Polski)\n\n## Installation\n\n```bash\ngit clone git@github.com:PythonicNinja/nbp_rates.git\ncd nbp_rates\npip install -e .\n```\n\nAfter that you will have `nbp_rates` command available in your shell.\n\n## Fetcher\n\nFetcher is a default mode of this utility. It fetches exchange rates from NBP and prints them to stdout.\n\n```python\n| =\u003e nbp_rates --currency eur --select-period 12\n2023-02-01\t4.708\n2023-02-02\t4.7079\n2023-02-03\t4.692\t\u003c--MIN\n2023-02-06\t4.7195\n2023-02-07\t4.7476\n2023-02-08\t4.7402\n2023-02-09\t4.7363\n2023-02-10\t4.7716\n2023-02-13\t4.7895\t\u003c--MAX\n2023-02-14\t4.7847\n2023-02-15\t4.7593\n2023-02-16\t4.7728\n2023-02-17\t4.7747\n2023-02-20\t4.7542\n2023-02-21\t4.7469\n2023-02-22\t4.7538\n2023-02-23\t4.7525\n2023-02-24\t4.7245\n2023-02-27\t4.7162\n2023-02-28\t4.717\n```\n\n```python\n| =\u003e nbp_rates\n2023-03-01\t4.6925\n2023-03-02\t4.675\t\u003c--MIN\n2023-03-03\t4.7046\n2023-03-06\t4.7073\n2023-03-07\t4.6871\n2023-03-08\t4.7018\n2023-03-09\t4.6836\n2023-03-10\t4.6838\n2023-03-13\t4.6848\n2023-03-14\t4.6909\n2023-03-15\t4.7015\n2023-03-16\t4.6978\n2023-03-17\t4.7062\n2023-03-20\t4.7109\t\u003c--MAX\n```\n\nWith `--now` you can fetch current exchange rate.\n\n```python\n| =\u003e nbp_rates --currency eur --now\nbid_now\t\t4.7005\nask_now\t\t4.7074\nforex_now\t\t4.707\nbid_old\t\t4.7003\nask_old\t\t4.7074\nforex_old\t\t4.707\nask_trend\t\tneutral\nbid_trend\t\tup\nforex_trend\t\tneutral\n```\n\n## Predictor\n\nWith option of `--predict` you can predict exchange rate for next day.\nYou can choose between `ml` and `moving_average` model.\n\n`--predict ml` model uses machine learning algorithms to predict exchange rate. \n\n```python\n| =\u003e nbp_rates --predict ml\n{'linear_regression': 4.7109, 'svm': 4.69295, 'decision_tree': 4.7109, 'random_forest': 4.709264999999995, 'avg': 4.706003749999998}\n```\n\n`--predict moving_average` model uses simple arithmetic mean of exchange rates.\nIt will try to fit 3, 7, 14, 30, 90, 180, 300 days moving averages to given period.\n\n```python\nnbp_rates --currency eur --start=2022-12-01 --end=2023-03-31 --predict moving_average\n{'avg_3': 4.701833333333333, 'avg_7': 4.692657142857143, 'avg_14': 4.695278571428572, 'avg_30': 4.72594}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythonicninja%2Fnbp_rates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpythonicninja%2Fnbp_rates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythonicninja%2Fnbp_rates/lists"}