{"id":18672510,"url":"https://github.com/jdejaegh/python-irceline","last_synced_at":"2025-04-12T01:31:15.120Z","repository":{"id":244589764,"uuid":"815464983","full_name":"jdejaegh/python-irceline","owner":"jdejaegh","description":"Get IRCEL - CELINE air quality data 🍃 🇧🇪","archived":false,"fork":false,"pushed_at":"2024-12-05T22:18:41.000Z","size":137,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T21:23:03.796Z","etag":null,"topics":["air-quality","air-quality-data","belgium","irceline","open-data","opendata"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/open-irceline/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdejaegh.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":"2024-06-15T08:35:08.000Z","updated_at":"2024-12-05T22:18:46.000Z","dependencies_parsed_at":"2024-11-07T09:11:57.637Z","dependency_job_id":"5929aff2-057c-42b7-bd59-625e585e829c","html_url":"https://github.com/jdejaegh/python-irceline","commit_stats":null,"previous_names":["jdejaegh/python-irceline"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdejaegh%2Fpython-irceline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdejaegh%2Fpython-irceline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdejaegh%2Fpython-irceline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdejaegh%2Fpython-irceline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdejaegh","download_url":"https://codeload.github.com/jdejaegh/python-irceline/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248504227,"owners_count":21115135,"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":["air-quality","air-quality-data","belgium","irceline","open-data","opendata"],"created_at":"2024-11-07T09:11:47.287Z","updated_at":"2025-04-12T01:31:14.843Z","avatar_url":"https://github.com/jdejaegh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple asynchronous Python client for IRCEL - CELINE open data\n\n**Work in progress**\n\nPython module to get data from the [IRCEL - CELINE open data](https://irceline.be/en/documentation/open-data)\n\nTarget features:\n\n- [X] Get data for real time measurements interpolated\n- [X] Get forecast data for PM10, PM2.5 and O3\n- [X] Compute or fetch BelAQI index (observation and forecast)\n- [ ] Maybe: also provide data from the stations and not only interpolation\n\n## Install\n\nThe library is published on PyPI.  Install it using `pip`\n\n```shell\npip install open-irceline\n```\n\n## Example of use\n\n```python\nimport aiohttp\nimport asyncio\nfrom datetime import datetime\nfrom open_irceline import IrcelineRioClient, IrcelineForecastClient, ForecastFeature, RioFeature\n\n\nasync def get_rio_interpolated_data():\n    \"\"\"Get current level of PM2.5 and PM10 at Brussels from the RIO interpolated data\"\"\"\n    async with aiohttp.ClientSession() as session:\n        client = IrcelineRioClient(session)\n        result = await client.get_data(\n            timestamp=datetime.utcnow(),  # must be timezone aware\n            features=[RioFeature.PM25_HMEAN, RioFeature.PM10_HMEAN],\n            position=(50.85, 4.35)  # (lat, lon) for Brussels\n        )\n\n    print(f\"PM2.5  {result[RioFeature.PM25_HMEAN]['value']} µg/m³\")\n    print(f\"PM10   {result[RioFeature.PM10_HMEAN]['value']} µg/m³\")\n\n\nasync def get_o3_forecast():\n    \"\"\"Get forecast for O3 concentration for Brussels for the next days\"\"\"\n    async with aiohttp.ClientSession() as session:\n        client = IrcelineForecastClient(session)\n        result = await client.get_data(\n            features=[ForecastFeature.O3_MAXHMEAN],\n            position=(50.85, 4.35)  # (lat, lon) for Brussels\n        )\n\n    for (feature, day), v in result.items():\n        print(f\"{feature} {day} {v['value']} µg/m³\")\n\n\nasync def get_belaqi_forecast():\n    \"\"\"Get current BelAQI index from RIO interpolated values\"\"\"\n    async with aiohttp.ClientSession() as session:\n        client = IrcelineForecastClient(session)\n        result = await client.get_data(\n            features=[ForecastFeature.BELAQI],\n            position=(50.85, 4.35)        # (lat, lon) for Brussels\n        )\n\n    for (_, day), value in result.items():\n        print(day, value['value'])\n\n\nif __name__ == '__main__':\n    print(\"\\nInterpolated data\")\n    asyncio.run(get_rio_interpolated_data())\n\n    print(\"\\nO3 forecast for Brussels\")\n    asyncio.run(get_o3_forecast())\n\n    print(\"\\nForecast BelAQI index\")\n    asyncio.run(get_belaqi_forecast())\n```\n\n## Attribution\n\nThe data provided by this module is provided by the [Belgian Interregional Environment Agency (IRCEL - CELINE)](https://www.irceline.be/en). \nNo change to the provided data is made. \nTheir data is made available under the [Creative Commons Attribution 4.0 license](https://creativecommons.org/licenses/by/4.0/). \n\nThis work is not endorsed by the Belgian Interregional Environment Agency (IRCEL - CELINE).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdejaegh%2Fpython-irceline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdejaegh%2Fpython-irceline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdejaegh%2Fpython-irceline/lists"}