{ "info": { "author": "Yann B\u00fcchau", "author_email": "nobodyinperson@gmx.de", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "co2logserver Python package\n===========================\n\n[![Build](https://gitlab.com/tue-umphy/co2mofetten/python3-co2logserver/badges/master/build.svg)](https://gitlab.com/tue-umphy/co2mofetten/python3-co2logserver/commits/master)\n[![Documentation](https://img.shields.io/badge/docs-sphinx-brightgreen.svg)](https://tue-umphy.gitlab.io/co2mofetten/python3-co2logserver/)\n[![Coverage](https://gitlab.com/tue-umphy/co2mofetten/python3-co2logserver/badges/master/coverage.svg)](https://tue-umphy.gitlab.io/co2mofetten/python3-co2logserver/coverage-report)\n[![PyPi](https://badge.fury.io/py/co2logserver.svg)](https://badge.fury.io/py/co2logserver)\n\nThis package provides a simple server for logging data.\n\nDocumentation\n-------------\n\nYou can find detailed documentation of this package [here on on\nGitlab](https://tue-umphy.gitlab.io/co2mofetten/python3-co2logserver/).\n\n### Local installation\n\nInstall this module from the repository root via `pip`:\n\n```bash\n# local user library under ~/.local\npip3 install --user .\n# also install msgpack support\npip3 install --user '.[msgpack]'\n# also install OpenSenseMap support\npip3 install --user '.[opensensemap]'\n```\n\n### Running\n\n#### Development\n\nTo run the server in development mode, run after the installation:\n\n```bash\npython3 -m co2logserver\n```\n\nYou might want to add the options `-v -t -d`.\n\n#### Production\n\nTo run the server in a production environment, use the `gunicorn`\nWSGI-server for example:\n\n```bash\npip3 install --user gunicon\n```\n\n```bash\ngunicorn co2logserver\n```\n\n#### Configuration\n\nYou can always specify the path to a configuration file via the\n`CO2LOGSERVER_CONFIG` environment variable. See the file\n`co2logserver/config_default.py` for default settings.\n\n#### Data Management\n\nTo upload data to the server, you may send `POST` requests to the\n`/upload` path:\n\n| Type | ``Content-Type`` | data example |\n|--------------------------------|---------------------------------------|------------------------------------------------------------|\n| JSON | ``application/json`` | ``{\"time_utc\":[43,23],\"co2\":[1223,2351]}`` |\n| CSV | ``text/csv`` | ``time_utc,co2\\n43,1223\\n23,2351`` |\n| FORM | ``application/x-www-form-urlencoded`` | ``time_utc=43&co2=1223&time_utc=23&co2=2351`` |\n| [MSGPACK](https://msgpack.org) | ``application/msgpack`` | ``82a874696d655f757463922b17a3636f3292cd04c7cd092f`` (HEX) |\n\n\nNew data columns are automatically added to the database. Every column\nname is converted to lowercase.\n\n#### Authentication\n\nIf you want to control who is allowed to upload data to the server, you\nmay use the PSK (pre-shared-key) salting mechanism built into the\nserver.\n\nSet `CO2LOGSERVER_UPLOAD_REQUIRES_AUTH=True` and specify one or more PSK salt\nstrings, e.g. `CO2LOGSERVER_CHECKSUM_SALTS = [\"my-super-secret-psk\"]`.\n\nBy default, the server then only accepts requests including at least one header\nfield `Content-HASHALGORITHM-Salted` containing the hexadecimal hash of the\nsent payload with the salt appended calculated with HASHALGORITHM (e.g. MD5,\nSHA1, SHA256, etc...).\n\nFor example, if you want to upload the JSON data\n`{\"time_utc\":[43,23],\"co2\":[1223,2351]}` and your salt string is\n`my-super-secret-psk`, your header field `Content-MD5-Salted` would be\n`b71e91feb2be18ccca019914a1da5b1d` which is the MD5-sum of\n`{\"time_utc\":[43,23],\"co2\":[1223,2351]}my-super-secret-psk`.\n\nThis is a simple yet effective way of preventing spam uploads.\n\n> #### Security Note\n>\n> Note, however, that communication to the server is still unencrypted (only\n> HTTP, not HTTPS). The reason for this is that embedded devices like Arduinos\n> do not have the capabilities for encrypted web traffic. Thus, the sent data\n> including the checksums can theoretically be intercepted and reused to\n> *reupload the exact same dataset*.\n\n#### OpenSenseMap upload\n\nUsing the [sensemapi package](https://pypi.org/project/sensemapi/),\n`co2logserver` is able to redirect uploaded data to the\n[OpenSenseMap](https://opensensemap.org). For this to work, an OpenSenseMap\naccount is necessary whose login credentials are set in the `co2logserver`\nconfiguration. The default configuration takes the credentials from the\nenvironment variables `SENSEMAP_EMAIL`, `SENSEMAP_USERNAME` and\n`SENSEMAP_PASSWORD`. Also setting `CO2LOGSERVER_OSEM_UPLOAD` to `True` in the\nconfiguration enables uploaded data to also be redirected to the OpenSenseMap.\nThe `config_default.py` contains explanations for further customization\noptions.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/tue-umphy/co2mofetten/python3-co2logserver", "keywords": "measurement,logging", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "co2logserver", "package_url": "https://pypi.org/project/co2logserver/", "platform": "", "project_url": "https://pypi.org/project/co2logserver/", "project_urls": { "Homepage": "https://gitlab.com/tue-umphy/co2mofetten/python3-co2logserver" }, "release_url": "https://pypi.org/project/co2logserver/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "simple HTTP server for CO2 data logging", "version": "0.1.2" }, "last_serial": 4988675, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "9286be04e2c5434152bae252f5a77a91", "sha256": "9e34451d1e0e4eaf995dd373f37c071492cf8e7dcd2b20afebc915a45296440c" }, "downloads": -1, "filename": "co2logserver-0.0.1.tar.gz", "has_sig": false, "md5_digest": "9286be04e2c5434152bae252f5a77a91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24926, "upload_time": "2019-03-26T17:25:05", "url": "https://files.pythonhosted.org/packages/82/8c/a582530830d0479effb28823c9018e4dc347ce1b72231ce3ad14a25d4fd5/co2logserver-0.0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "7c3b7210dc58c7a1f3cca61b1d16c43f", "sha256": "7b2a83f6d43ce98952edd6361b3d0c23c43b3819e62c5c1b93c2bdc3e175b865" }, "downloads": -1, "filename": "co2logserver-0.1.1.tar.gz", "has_sig": false, "md5_digest": "7c3b7210dc58c7a1f3cca61b1d16c43f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24975, "upload_time": "2019-03-26T17:34:41", "url": "https://files.pythonhosted.org/packages/6d/32/ee0948e6d99ca8a96087565eacbd7660555f2523770bc891a31b6f4be943/co2logserver-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "d39daa2715d027690283f657da5bd387", "sha256": "84b39df62febef4465c347ab5ff4683748d121e7fae62687abd86855e38aa420" }, "downloads": -1, "filename": "co2logserver-0.1.2.tar.gz", "has_sig": false, "md5_digest": "d39daa2715d027690283f657da5bd387", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24996, "upload_time": "2019-03-26T17:38:33", "url": "https://files.pythonhosted.org/packages/1e/9c/22f0380a2ac7ba05140c8f3949d26a469b2557cb7ba251f9e5d116f73e5b/co2logserver-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d39daa2715d027690283f657da5bd387", "sha256": "84b39df62febef4465c347ab5ff4683748d121e7fae62687abd86855e38aa420" }, "downloads": -1, "filename": "co2logserver-0.1.2.tar.gz", "has_sig": false, "md5_digest": "d39daa2715d027690283f657da5bd387", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24996, "upload_time": "2019-03-26T17:38:33", "url": "https://files.pythonhosted.org/packages/1e/9c/22f0380a2ac7ba05140c8f3949d26a469b2557cb7ba251f9e5d116f73e5b/co2logserver-0.1.2.tar.gz" } ] }