{
"info": {
"author": "Emanuele Di Giacomo",
"author_email": "edigiacomo@arpa.emr.it",
"bugtrack_url": null,
"classifiers": [],
"description": "borinud\n=======\n\n.. contents::\n\nIntroduction\n------------\n\n**TODO**\n\n\nDependencies\n------------\n\n- `python-dballe `_\n- `python-bottle `_\n\nInstallation\n------------\n\nFrom source code:\n\n::\n\n python setup.py install\n\nContext url\n-----------\n\n::\n\n /IDENT/COORDINATES/NETWORK/TIMERANGE/LEVEL/BCODE\n\n- ``IDENT``: mobile station identifier or ``-`` for fixed stations\n- ``COORDINATES``: coordinates in format ``int(lon*10^5),int(lat*10^5)``\n - e.g.: ``1212345,4467890`` means longitude 12.12345 and latitude 44.67890\n- ``NETWORK``: station network (max 16 characters)\n- ``TIMERANGE``: time range in format ``type,p1,p2``\n- ``LEVEL``: level in format ``type1,l1,type2,l2`` (``-`` means missing)\n- ``BCODE``: local B table descriptor if format ``BXXYYY``\n\nExample of context url\n^^^^^^^^^^^^^^^^^^^^^^\n\nInstantaneous temperature at 2m above ground measured by fixed station at\nlongitude 12.12345, latitude 44.67890 in network \"agrmet\"::\n\n /-/1212345,4467890/agrmet/254,0,0/103,2000,-,-/B12101\n\nWeb interface\n-------------\n\nA simple web interface is available at the base dir ``/``.\n\n\nWeb API\n-------\n\nThe response is in ``GeoJSON`` format (http://geojson.org/)::\n\n {\n \"type\": \"FeatureCollection\",\n \"features\": [\n {\n \"geometry\": { \"type\": \"Point\", \"coordinates\": [ 11.95861, 44.36013 ] },\n \"properties\": {\n \"ident\": null,\n \"lon\": 1195861,\n \"lat\": 4436013,\n \"network\": \"locali\",\n \"trange_pind\": 254,\n \"trange_p1\": 0,\n \"trange_p2\": 0,\n \"level_t1\": 103,\n \"level_v1\": 2000,\n \"level_t2\": null,\n \"level_v2\": null,\n \"bcode\": \"B12101\"\n }\n },\n {\n ...\n }\n ]\n }\n\nThe services can extend the property list (e.g. ``datetime`` and ``value`` for timeseries services).\n\nThe services support the ``JSONP`` format, using the ``GET`` parameter ``callback=NAME``.\n\nSummaries\n^^^^^^^^^\n\n::\n\n /*/*/*/*/*/*/summaries\n /*/*/NETWORK/*/*/*/summaries\n /-/COORDINATES/NETWORK/*/*/*/summaries\n /IDENT/*/NETWORK/*/*/*/summaries\n /*/*/NETWORK/TIMERANGE/LEVEL/BCODE/summaries/YEAR/MONTH\n /*/*/NETWORK/TIMERANGE/LEVEL/BCODE/summaries/YEAR/MONTH/DAY\n\nThe features have a ``datetime`` property: if the date extremes are available,\nthen is an array with min and max date. Otherwise, is ``null``.\n\nTime series\n^^^^^^^^^^^\n\n::\n\n /IDENT/COORDINATES/NETWORK/TIMERANGE/LEVEL/BCODE/timeseries/YEAR\n /IDENT/COORDINATES/NETWORK/TIMERANGE/LEVEL/BCODE/timeseries/YEAR/MONTH\n /IDENT/COORDINATES/NETWORK/TIMERANGE/LEVEL/BCODE/timeseries/YEAR/MONTH/DAY\n\nThe features have a ``datetime`` and ``value`` property.\n\nExample of timeseries\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n::\n\n $ curl http://host/path/to/-/1200000,4400000/agrmet/254,0,0/103,10000,-,-/B12101/timeseries/2011\n $ curl http://host/path/to/-/1200000,4400000/agrmet/254,0,0/103,10000,-,-/B12101/timeseries/2011/01\n $ curl http://host/path/to/-/1200000,4400000/agrmet/254,0,0/103,10000,-,-/B12101/timeseries/2011/01/01\n\nSpatial series\n^^^^^^^^^^^^^^\n\n::\n\n /*/*/NETWORK/TIMERANGE/LEVEL/BCODE/spatialseries/YEAR/MONTH/DAY/HOUR\n\nThe features have a ``datetime`` and ``value`` property.\n\nStation data\n^^^^^^^^^^^^\n\n::\n\n /-/COORDINATES/NETWORK/-,-,-/257,-,-,-/*/stationdata\n /IDENT/*/-,-,-/257,-,-,-/*/stationdata\n\nThe features have a ``value`` property.\n\nSimple web server\n-----------------\n\nThe ``borinud.ws`` module has a simple web server tool::\n\n python -m borinud.ws --dsn=sqlite://...\n\nOr run ``python -m borinud.ws --help`` for more options.\n\nDeployement under Apache with mod_wsgi\n--------------------------------------\n\nThe Apache configuration is something like this (see\nhttp://code.google.com/p/modwsgi/ for details)::\n\n \n WSGIDaemonProcess borinud user=www-data group=www-data processes=10 threads=1\n WSGIScriptAlias /borinud /var/www/borinud/app.wsgi\n \n\nAnd you must create the file ``/var/www/borinud/app.wsgi``::\n\n import borinud.ws\n import borinud.db\n\n dba_dsn = \"sqlite:/dev/shm/borinud.db\"\n\n application = borinud.ws.app\n application.config.db = borinud.db.DballeDB(dba_dsn)\n\nDatabase\n--------\n\n``borinud`` reads data from a ``DB-All.e`` database::\n\n from borinud.db import DballeDB\n # Create a DB-All.e database\n db = DballeDB(\"sqlite:mydatabase.sqlite\")\n # Load the summary\n summary = db.query_summary(dballe.Record())\n # Load temperature data\n data = db.query_data(dballe.Record(var=\"B12101\"))\n\nCaching the summary\n^^^^^^^^^^^^^^^^^^^\n\nIf the database has a lot of data, loading the summary could be a bottle neck.\nYou can dump the summary in a file and use it as a preemptive cache::\n\n import dballe\n from borinud.db import DballeDB, SummaryCacheDB\n # Create a DB-All.e database with cached summary\n db = SummaryCacheDB(DballeDB(\"sqlite:mydatabase.sqlite\"), \"/var/lib/borinud-summary.json\")\n # Dump cached summary in /var/lib/borinud-summary.json.\n # NOTE: the cached summary must be written before using it\n db.write_cached_summary()\n # Load the summary\n summary = db.query_summary(dballe.Record())\n # Load temperature data\n data = db.query_data(dballe.Record(var=\"B12101\"))\n # Update the summary cache\n db.write_cached_summary()\n\nThe web service can use a summary cache::\n\n python -m borinud.ws --dsn=sqlite:mydatabase.sqlite --cached-summary=/var/lib/borinud-summary.json\n\nAnd the cache can be updated by a simple script::\n\n #!/usr/bin/python\n # cacheupdater.py\n from borinud.db import DballeDB, SummaryCacheDB\n db = SummaryCacheDB(DballeDB(\"sqlite:mydatabase.sqlite\"), \"/var/lib/borinud-summary.json\")\n db.write_cached_summary()\n\nThis script can be executed by ``cron`` to update periodically the summary::\n\n */10 * * * * python cacheupdater.py\n\n.. note::\n When the web service starts, the summary *must* be already created::\n\n python cacheupdater.py && python -m borinud.ws --dsn=sqlite:mydatabase.sqlite --cached-summary=/var/lib/borinud-summary.json\n\nCopyright\n---------\n\n::\n\n Copyright (C) 2013 ARPA-SIM \n\n This program is free software; you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation; either version 2 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License along\n with this program; if not, write to the Free Software Foundation, Inc.,\n 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\nChangeLog\n=========\n\n::\n\n Copyright (C) 2013 ARPA-SIM \n\n This program is free software; you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation; either version 2 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License along\n with this program; if not, write to the Free Software Foundation, Inc.,\n 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\nborinud 0.7.3 (2014-10-08)\n--------------------------\n\n- Fixed web api /stationdata\n\nborinud 0.7.2 (2014-09-30)\n--------------------------\n\n- Patch for compatibility with ECMAScript-ed6 (Date.parse())\n\nborinud 0.7 (2014-09-24)\n------------------------\n\n- Daily summary\n- Daily timeseries in web interface\n\n\nborinud 0.6 (2014-09-08)\n------------------------\n\n- Removed autotools\n- Sphinx documentation\n\nborinud 0.5\n-----------\n\n- Summary cache filter\n- (Optional) versioned web api\n\nborinud 0.4\n-----------\n\n- Summary cache wrapper\n\nborinud 0.3\n-----------\n\n- Summary response contains items description.\n- Example web client has a dynamic variable list.\n\nborinud 0.2 \n-----------\n\n- Example web client plots monthly timeseries\n\nContributors\n============\n\n* Emanuele Di Giacomo ",
"description_content_type": null,
"docs_url": "https://pythonhosted.org/borinud/",
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "http://sourceforge.net/projects/r-map/",
"keywords": "ARPA SIMC weather station sensor GIS",
"license": "GPLv2+",
"maintainer": null,
"maintainer_email": null,
"name": "borinud",
"package_url": "https://pypi.org/project/borinud/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/borinud/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "http://sourceforge.net/projects/r-map/"
},
"release_url": "https://pypi.org/project/borinud/0.7.3/",
"requires_dist": null,
"requires_python": null,
"summary": "weather data web api",
"version": "0.7.3"
},
"last_serial": 1458286,
"releases": {
"0.7.1": [
{
"comment_text": "",
"digests": {
"md5": "93804a8c654f06f71f87bce21cf645d1",
"sha256": "87e289afd1bd9c12018baa267a931d63b38e30b8304ade0a3f0d41251d749aab"
},
"downloads": -1,
"filename": "borinud-0.7.1.tar.gz",
"has_sig": false,
"md5_digest": "93804a8c654f06f71f87bce21cf645d1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 35046,
"upload_time": "2014-09-26T06:59:10",
"url": "https://files.pythonhosted.org/packages/c3/a8/4aad7b1f63bba55f136aae4cb8015de0f1b1439cb343417320da223b3c58/borinud-0.7.1.tar.gz"
}
],
"0.7.2": [
{
"comment_text": "",
"digests": {
"md5": "a32355c35b011150399ba99e4914f5bc",
"sha256": "3c4739ff45c86dd687fd8a8e80b4b055adbc333a9bc356a4894ac713bb09e406"
},
"downloads": -1,
"filename": "borinud-0.7.2.tar.gz",
"has_sig": false,
"md5_digest": "a32355c35b011150399ba99e4914f5bc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 35157,
"upload_time": "2014-09-30T09:26:37",
"url": "https://files.pythonhosted.org/packages/14/9d/517b38a9bc402f94dcf9324645d18e99e01253eacec933e035d82fca51f7/borinud-0.7.2.tar.gz"
}
],
"0.7.3": [
{
"comment_text": "",
"digests": {
"md5": "3bfa3506d4d4bf9f8ff29bdd774ad778",
"sha256": "24f4bef5737088b3662f4fee65abebda9da44d8ac7fa1c9b6116eeaca9755c9d"
},
"downloads": -1,
"filename": "borinud-0.7.3.tar.gz",
"has_sig": false,
"md5_digest": "3bfa3506d4d4bf9f8ff29bdd774ad778",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 35523,
"upload_time": "2015-03-11T18:04:57",
"url": "https://files.pythonhosted.org/packages/eb/af/4d0b30d8f6ad394e8e08f64e70c8dc1dec56811f2d27fd9bd0e96bcc1439/borinud-0.7.3.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "3bfa3506d4d4bf9f8ff29bdd774ad778",
"sha256": "24f4bef5737088b3662f4fee65abebda9da44d8ac7fa1c9b6116eeaca9755c9d"
},
"downloads": -1,
"filename": "borinud-0.7.3.tar.gz",
"has_sig": false,
"md5_digest": "3bfa3506d4d4bf9f8ff29bdd774ad778",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 35523,
"upload_time": "2015-03-11T18:04:57",
"url": "https://files.pythonhosted.org/packages/eb/af/4d0b30d8f6ad394e8e08f64e70c8dc1dec56811f2d27fd9bd0e96bcc1439/borinud-0.7.3.tar.gz"
}
]
}