{ "info": { "author": "John Paton", "author_email": "john@johnpaton.net", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ], "description": "[![Build Status](https://travis-ci.com/JohnPaton/airbase.svg?branch=master)](https://travis-ci.com/JohnPaton/airbase)\n[![Documentation Status](https://readthedocs.org/projects/airbase/badge/?version=latest)](https://airbase.readthedocs.io/en/latest/?badge=latest)\n\n\n# AirBase\n\nAn easy downloader for the AirBase air quality data.\n\nAirBase is an air quality database provided by the European Environment Agency\n(EEA). The data is available for download at\n[the portal](http://discomap.eea.europa.eu/map/fme/AirQualityExport.htm), but\nthe interface makes it a bit time consuming to do bulk downloads. Hence, an easy\nPython-based interface.\n\nRead the full documentation at https://airbase.readthedocs.io.\n\n## Installation\n\nTo install `airbase`, simply run\n\n```bash\n$ pip install airbase\n```\n\n## Getting Started\n\nGet info about available countries and pollutants:\n\n```python\n>>> import airbase\n>>> client = airbase.AirbaseClient()\n>>> client.all_countries\n['GR', 'ES', 'IS', 'CY', 'NL', 'AT', 'LV', 'BE', 'CH', 'EE', 'FR', 'DE', ...\n\n>>> client.all_pollutants\n{'CO': '10', 'NO': '38', 'NO2': '8', 'NOX as NO2': '9', 'O3': '7', ...\n\n>>> client.pollutants_per_country\n{'AD': [{'pl': 'CO', 'shortpl': '10'}, {'pl': 'NO', 'shortpl': '38'}, ...\n\n>>> client.search_pollutant(\"O3\")\n[{'pl': 'O3', 'shortpl': '7'}, {'pl': 'NO3', 'shortpl': '46'}, ...\n```\n\nRequest download links from the server and save the resulting CSVs into a directory:\n\n```python\n>>> r = client.request(country=[\"NL\", \"DE\"], pl=\"NO3\", year_from=2015)\n>>> r.download_to_directory(dir=\"data\", skip_existing=True)\n```\n```\nGenerating CSV download links...\n100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 2/2 [00:03<00:00, 2.03s/it]\nGenerated 12 CSV links ready for downloading\nDownloading CSVs to data...\n100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 12/12 [00:01<00:00, 8.44it/s]\n```\n\nOr concatenate them into one big file:\n\n```python\n>>> r = client.request(country=\"FR\", pl=[\"O3\", \"PM10\"], year_to=2014)\n>>> r.download_to_file(\"data/raw.csv\")\n```\n```\nGenerating CSV download links...\n100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 2/2 [00:12<00:00, 7.40s/it]\nGenerated 2,029 CSV links ready for downloading\nWriting data to data/raw.csv...\n100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 2029/2029 [31:23<00:00, 1.04it/s]\n```\n\nDownload the entire dataset (not for the faint of heart):\n\n```python\n>>> r = client.request()\n>>> r.download_to_directory(\"data\")\n```\n```\nGenerating CSV download links...\n100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 40/40 [03:38<00:00, 2.29s/it]\nGenerated 146,993 CSV links ready for downloading\nDownloading CSVs to data...\n 0%| | 299/146993 [01:50<17:15:06, 2.36it/s]\n```\n\nDon't forget to get the metadata about the measurement stations:\n\n```python\n>>> client.download_metadata(\"data/metadata.csv\")\nWriting metadata to data/metadata.csv...\n```\n\n## Roadmap\n\n* **Tests**\n* Parallel CSV downloads (in progress)\n* CLI to avoid using Python all together\n* Data wrangling module for AirBase output data", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/johnpaton/airbase", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "airbase", "package_url": "https://pypi.org/project/airbase/", "platform": "", "project_url": "https://pypi.org/project/airbase/", "project_urls": { "Homepage": "https://github.com/johnpaton/airbase" }, "release_url": "https://pypi.org/project/airbase/0.2.4/", "requires_dist": null, "requires_python": ">=3.4.0", "summary": "An easy downloader for the AirBase air quality data.", "version": "0.2.4" }, "last_serial": 5960272, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "468bdad4014de48d4391b851446a7f19", "sha256": "a25b71e8887a7fc92923dc153f562c9d1b9eb10b3672da2cb90f2a2a742a841f" }, "downloads": -1, "filename": "airbase-0.1.0.tar.gz", "has_sig": false, "md5_digest": "468bdad4014de48d4391b851446a7f19", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 10454, "upload_time": "2019-03-11T19:22:17", "url": "https://files.pythonhosted.org/packages/6b/71/a92434a712067ea836272c26b6394f19c81f1d5d827bc6b834b603126543/airbase-0.1.0.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "2c6e568bfe6ae1fc41737f59bc4d4072", "sha256": "588fdb36d6aa39830d197ed75eebd0a2cc0886d15334d1a34fb51d5728aeb81b" }, "downloads": -1, "filename": "airbase-0.2.2.tar.gz", "has_sig": false, "md5_digest": "2c6e568bfe6ae1fc41737f59bc4d4072", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.0", "size": 9976, "upload_time": "2019-04-22T13:24:15", "url": "https://files.pythonhosted.org/packages/df/6c/0c45184a63f1f11f0aff22e0e05af84b450a325947406f0d57c6ddd6e936/airbase-0.2.2.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "3c84751d1158add71847f5eb944decee", "sha256": "3bf4c7518440876e2e4a4d1560555cb9bd7eaf821117b2ac918f2bd824463c66" }, "downloads": -1, "filename": "airbase-0.2.4.tar.gz", "has_sig": false, "md5_digest": "3c84751d1158add71847f5eb944decee", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.0", "size": 10029, "upload_time": "2019-10-11T13:18:07", "url": "https://files.pythonhosted.org/packages/a8/89/15c8f82339c001e0180912156af2d4e5d75e710cc96f6b47997c04cd9065/airbase-0.2.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3c84751d1158add71847f5eb944decee", "sha256": "3bf4c7518440876e2e4a4d1560555cb9bd7eaf821117b2ac918f2bd824463c66" }, "downloads": -1, "filename": "airbase-0.2.4.tar.gz", "has_sig": false, "md5_digest": "3c84751d1158add71847f5eb944decee", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.0", "size": 10029, "upload_time": "2019-10-11T13:18:07", "url": "https://files.pythonhosted.org/packages/a8/89/15c8f82339c001e0180912156af2d4e5d75e710cc96f6b47997c04cd9065/airbase-0.2.4.tar.gz" } ] }