{"id":27888845,"url":"https://github.com/belidzs/apache-airflow-providers-mnb","last_synced_at":"2026-06-23T12:04:25.071Z","repository":{"id":65549908,"uuid":"589915342","full_name":"belidzs/apache-airflow-providers-mnb","owner":"belidzs","description":"Access exchange rates provided by Magyar Nemzeti Bank (MNB, Central Bank of Hungary) in Apache Airflow","archived":false,"fork":false,"pushed_at":"2023-01-28T21:35:17.000Z","size":88,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2026-03-27T07:27:28.440Z","etag":null,"topics":["airflow","airflow-provider","airflow-providers","apache-airflow","currency","currency-exchange-rate","currency-exchange-rates","mnb","python"],"latest_commit_sha":null,"homepage":"","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/belidzs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2023-01-17T08:39:48.000Z","updated_at":"2023-03-08T11:37:07.000Z","dependencies_parsed_at":"2023-02-15T19:01:04.216Z","dependency_job_id":null,"html_url":"https://github.com/belidzs/apache-airflow-providers-mnb","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/belidzs/apache-airflow-providers-mnb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belidzs%2Fapache-airflow-providers-mnb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belidzs%2Fapache-airflow-providers-mnb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belidzs%2Fapache-airflow-providers-mnb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belidzs%2Fapache-airflow-providers-mnb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/belidzs","download_url":"https://codeload.github.com/belidzs/apache-airflow-providers-mnb/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/belidzs%2Fapache-airflow-providers-mnb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34686734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["airflow","airflow-provider","airflow-providers","apache-airflow","currency","currency-exchange-rate","currency-exchange-rates","mnb","python"],"created_at":"2025-05-05T09:28:59.644Z","updated_at":"2026-06-23T12:04:25.044Z","avatar_url":"https://github.com/belidzs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MNB Provider for Apache Airflow\n\nThis package contains all the necessary operators, hooks and sensors necessary to access the daily exchange rates published by MNB (Central Bank of Hungary) in Apache Airflow.\n\n## Installation\n\nYou can install it with any package manager compatible with PyPI:\n\n```\npip install apache-airflow-provider-mnb\n```\n\n## Components\n\n| Component | Notes |\n| - | - |\n| `MnbHook` | Implements low-level functions to interact with MNB's API |\n| `MnbExchangeRateOperator` | Provides access to the exchange rates published on a specific day |\n| `MnbExchangeRateSensor` | Senses whether the rates were already published for a specific day\n\n## Example\nThis following example demonstrates a typical use case:\n\n1. Start running at 8:00AM every day\n1. Check if the exchange rates were already published (repeat every 10 minutes)\n1. Permanently fail after 3 hours if the rates were never published (there are no rates available on the weekends and public holidays)\n1. Generate the SQL commands\n1. Run them against a PostgreSQL database\n\n```python\nfrom datetime import date\nimport json\nimport pendulum\nfrom airflow.decorators import dag, task\nfrom airflow.providers.postgres.operators.postgres import PostgresOperator\nfrom airflow.providers.mnb.sensors.mnb import MnbExchangeRateSensor\nfrom airflow.providers.mnb.operators.mnb import MnbExchangeRateOperator\n\n@dag(\n    dag_id=\"refresh_currency_rates\",\n    description=\"Refresh currency exchange rates\",\n    schedule=\"0 8 * * *\",\n    start_date=pendulum.datetime(2023, 1, 16, tz=\"Europe/Budapest\"),\n    catchup=False\n)\ndef mnb():\n    is_exchange_rate_available = MnbExchangeRateSensor(\n        task_id=\"is_exchange_rate_available\",\n        timeout=10800,\n        poke_interval=600,\n        date=\"{{ ds }}\"\n    )\n    \n    exchange_rates = MnbExchangeRateOperator(\n        task_id=\"get_exchange_rates\",\n        date=\"{{ ds }}\"\n    )\n    \n    @task\n    def generate_queries(exchange_rates: str):\n        rates = json.loads(exchange_rates)\n        queries = \"\"\n        mnb_date = rates[\"date\"]\n        for rate in rates[\"rates\"]:\n            currency_id = rate[\"currency\"]\n            mnb_rate = rate[\"rate\"]\n            queries += f\"UPDATE finance.currency SET mnb_rate = '{mnb_rate}', mnb_date = '{mnb_date}' WHERE currency_id = '{currency_id}';\\n\"\n        return queries\n\n    is_exchange_rate_available \u003e\u003e exchange_rates\n\n    queries = generate_queries(exchange_rates.output)\n    PostgresOperator(\n        task_id=\"update_exchange_rates\",\n        postgres_conn_id=\"postgres_default\",\n        database=\"erp\",\n        sql=queries)\n\nmnb()\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelidzs%2Fapache-airflow-providers-mnb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbelidzs%2Fapache-airflow-providers-mnb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelidzs%2Fapache-airflow-providers-mnb/lists"}