# air-db
_air-db_ is a data access layer (DAL) to easily query atmospheric time series datasets from various sources. _air-db_ does not include any database. It is required to install corresponding database to work _air-db_ properly.
To install sample database:
```python3
from airdb import Database
Database.install_sample()
```
A database query can be implemented as follows:
```python3
from airdb import Database
db = Database('samp', return_type='df')
q = db.query(param=['so2', 'pm10'], city='istanbul', date=['>2010-05-10', '<2012-10-07'], month=5)
print(q)
del db # close connection to database
```
and the output is:
```
param reg city sta date value
0 pm10 marmara istanbul çatladıkapı 2010-05-10 00:00:00 0.798218
1 pm10 marmara istanbul çatladıkapı 2010-05-10 01:00:00 0.946180
2 pm10 marmara istanbul çatladıkapı 2010-05-10 02:00:00 0.884385
3 pm10 marmara istanbul çatladıkapı 2010-05-10 03:00:00 0.537993
4 pm10 marmara istanbul çatladıkapı 2010-05-10 04:00:00 0.136689
... ... ... ... ... ... ...
16123 so2 marmara istanbul şirinevler mthm 2012-05-31 19:00:00 0.697663
16124 so2 marmara istanbul şirinevler mthm 2012-05-31 20:00:00 0.615755
16125 so2 marmara istanbul şirinevler mthm 2012-05-31 21:00:00 0.489289
16126 so2 marmara istanbul şirinevler mthm 2012-05-31 22:00:00 0.385102
16127 so2 marmara istanbul şirinevler mthm 2012-05-31 23:00:00 0.039451
[16128 rows x 6 columns]
```
Raw data
{
"_id": null,
"home_page": "https://github.com/isezen/air-db",
"name": "air-db",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "data,environment,pollutant,meteorology,turkey",
"author": "Ismail SEZEN",
"author_email": "sezenismail@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e4/cf/6ea4b73e795c7e0541ac0b9fb03a2e4c929f6f9c5b43b5f03f00c30a7d1b/air-db-0.1.8.tar.gz",
"platform": "linux",
"description": "# air-db\n\n_air-db_ is a data access layer (DAL) to easily query atmospheric time series datasets from various sources. _air-db_ does not include any database. It is required to install corresponding database to work _air-db_ properly.\n\nTo install sample database:\n\n```python3\nfrom airdb import Database\n\nDatabase.install_sample()\n```\n\nA database query can be implemented as follows:\n\n```python3\nfrom airdb import Database\n\ndb = Database('samp', return_type='df')\n\nq = db.query(param=['so2', 'pm10'], city='istanbul', date=['>2010-05-10', '<2012-10-07'], month=5)\n\nprint(q)\n\ndel db # close connection to database\n\n```\n\nand the output is:\n```\n param reg city sta date value\n0 pm10 marmara istanbul \u00e7atlad\u0131kap\u0131 2010-05-10 00:00:00 0.798218\n1 pm10 marmara istanbul \u00e7atlad\u0131kap\u0131 2010-05-10 01:00:00 0.946180\n2 pm10 marmara istanbul \u00e7atlad\u0131kap\u0131 2010-05-10 02:00:00 0.884385\n3 pm10 marmara istanbul \u00e7atlad\u0131kap\u0131 2010-05-10 03:00:00 0.537993\n4 pm10 marmara istanbul \u00e7atlad\u0131kap\u0131 2010-05-10 04:00:00 0.136689\n... ... ... ... ... ... ...\n16123 so2 marmara istanbul \u015firinevler mthm 2012-05-31 19:00:00 0.697663\n16124 so2 marmara istanbul \u015firinevler mthm 2012-05-31 20:00:00 0.615755\n16125 so2 marmara istanbul \u015firinevler mthm 2012-05-31 21:00:00 0.489289\n16126 so2 marmara istanbul \u015firinevler mthm 2012-05-31 22:00:00 0.385102\n16127 so2 marmara istanbul \u015firinevler mthm 2012-05-31 23:00:00 0.039451\n\n[16128 rows x 6 columns]\n```\n",
"bugtrack_url": null,
"license": "AGPLv3",
"summary": "A data access layer for atmospheric time series datasets",
"version": "0.1.8",
"split_keywords": [
"data",
"environment",
"pollutant",
"meteorology",
"turkey"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e4cf6ea4b73e795c7e0541ac0b9fb03a2e4c929f6f9c5b43b5f03f00c30a7d1b",
"md5": "a7581cec5d36cffebb2098b5a8ad5b8a",
"sha256": "91f6864e9be7a707fe352c3534a5f57dfc13e0b82fba224d5e963f9cfacb1912"
},
"downloads": -1,
"filename": "air-db-0.1.8.tar.gz",
"has_sig": false,
"md5_digest": "a7581cec5d36cffebb2098b5a8ad5b8a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 28163,
"upload_time": "2023-01-17T23:06:41",
"upload_time_iso_8601": "2023-01-17T23:06:41.128373Z",
"url": "https://files.pythonhosted.org/packages/e4/cf/6ea4b73e795c7e0541ac0b9fb03a2e4c929f6f9c5b43b5f03f00c30a7d1b/air-db-0.1.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-17 23:06:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "isezen",
"github_project": "air-db",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "air-db"
}