openkongqi


Nameopenkongqi JSON
Version 0.2.12 PyPI version JSON
download
home_pagehttps://github.com/gams/openkongqi
SummaryOutdoor air quality data
upload_time2023-12-04 05:28:31
maintainer
docs_urlNone
authorStefan Berder
requires_python
licenseApache License 2.0
keywords air quality
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            #####################################
openkongqi - outdoor air quality data
#####################################

.. image:: https://travis-ci.org/gams/openkongqi.svg?branch=master
    :target: https://travis-ci.org/gams/openkongqi
    :alt: Testing Status

Fetch outdoor air quality data from multiple resources, the system is made of
the following components:

* fetching: fetches resources to create the raw material for air
  quality data. That material is saved to create a history and possibility to
  fix errors after the fact.
* data extraction: extract the data from the raw material to create data feeds.
* data reliability: determine which data source is the most reliable at any
  given time.

Architecture
============

The data flow from online resource to reliable data point is broken down as
follow:

* sources: online resources that provide the data, polled at regular interval
  and cached for archive purpose
* feeds: extracted data from sources, feeds are saved as time series in a
  database
* datapoint: extracted from feeds using an election algorithm to provide the
  most reliable data

Configuration
=============

The default local configuration file is ``okqconfig.py``, this can be changed
using the environment variable ``OKQ_CONFMODULE``. The ``okqconfig.py`` file
should define a dict called ``settings``, this dict can be used to overwrite
any configuration option defined in the ``global_settings`` of
``openkongqi.conf``.

Station UUID
============

Each station needs to be attached to a unique identier, a station identifier is
of the following formats::

    CC/STATION
    CC/CITY/STATION
    CC/STATE/CITY/STATION

The following fragments compose the UUID:

* ``CC``: country code - a two letter country code as defined by ISO 3166-1
  alpha-2, mandatory.
* ``STATE``: state name - state name
* ``CITY``: city name - city name
* ``STATION``: stations name - station name, mandatory.

All names have to be expressed in Uppercase or lowercase or numeric latin letters.

Install
=======

Make sure the `lxml` package is installed, on debian:

.. code:: sh

    $ apt-get install python-lxml

Install the code:

.. code:: sh

    $ pip install -U pip
    $ pip install pip-tools
    $ pip-sync requirements.txt

Development
===========

Install development environment:

.. code-block:: sh

    $ pip install -r requirements-dev.txt

Create necessary database & tables:

.. code-block:: sh

    (openkongqi)$ python -c "import openkongqi.bin; openkongqi.bin.okq_init()"

Run celery:

.. code-block:: sh

    (openkongqi)$ python openkongqi/bin.py worker --loglevel=debug --concurrency=1 --autoreload -B

Test
----

Test the package:

.. code-block:: sh


    $ python -m unittest discover

Automatic testing in various environments:

.. code-block:: sh

    $ tox

Versioning
----------

Openkongqi tries to follow the `PEP 440
<https://www.python.org/dev/peps/pep-0440/#public-version-identifiers>`_ /
`Semver <http://semver.org/>`_ conventions as defined by `PyPA
<https://packaging.python.org/en/latest/distributing/#choosing-a-versioning-scheme>`_

To update the version of the package, use the following command:

.. code-block:: sh

    $ bumpr -b -p

Packaging
---------

Create packages:

.. code-block:: sh

    $ python setup.py sdist bdist_wheel

Push package:

.. code-block:: sh

    $ twine upload dist/*
    $ twine upload -r pypi dist/*

Name origin
===========

Kōngqì (空气) is the Chinese word for air/atmosphere.

License
=======

This software is licensed under the Apache License 2.0. See the LICENSE file in the top distribution directory for the full license text.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/gams/openkongqi",
    "name": "openkongqi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "air quality",
    "author": "Stefan Berder",
    "author_email": "stefan@measureofqualty.com",
    "download_url": "https://files.pythonhosted.org/packages/fe/4e/3c1ce13c1a5748c581e13321ad26175a9e9ed82145ae29fb1427116a70d9/openkongqi-0.2.12.tar.gz",
    "platform": null,
    "description": "#####################################\nopenkongqi - outdoor air quality data\n#####################################\n\n.. image:: https://travis-ci.org/gams/openkongqi.svg?branch=master\n    :target: https://travis-ci.org/gams/openkongqi\n    :alt: Testing Status\n\nFetch outdoor air quality data from multiple resources, the system is made of\nthe following components:\n\n* fetching: fetches resources to create the raw material for air\n  quality data. That material is saved to create a history and possibility to\n  fix errors after the fact.\n* data extraction: extract the data from the raw material to create data feeds.\n* data reliability: determine which data source is the most reliable at any\n  given time.\n\nArchitecture\n============\n\nThe data flow from online resource to reliable data point is broken down as\nfollow:\n\n* sources: online resources that provide the data, polled at regular interval\n  and cached for archive purpose\n* feeds: extracted data from sources, feeds are saved as time series in a\n  database\n* datapoint: extracted from feeds using an election algorithm to provide the\n  most reliable data\n\nConfiguration\n=============\n\nThe default local configuration file is ``okqconfig.py``, this can be changed\nusing the environment variable ``OKQ_CONFMODULE``. The ``okqconfig.py`` file\nshould define a dict called ``settings``, this dict can be used to overwrite\nany configuration option defined in the ``global_settings`` of\n``openkongqi.conf``.\n\nStation UUID\n============\n\nEach station needs to be attached to a unique identier, a station identifier is\nof the following formats::\n\n    CC/STATION\n    CC/CITY/STATION\n    CC/STATE/CITY/STATION\n\nThe following fragments compose the UUID:\n\n* ``CC``: country code - a two letter country code as defined by ISO 3166-1\n  alpha-2, mandatory.\n* ``STATE``: state name - state name\n* ``CITY``: city name - city name\n* ``STATION``: stations name - station name, mandatory.\n\nAll names have to be expressed in Uppercase or lowercase or numeric latin letters.\n\nInstall\n=======\n\nMake sure the `lxml` package is installed, on debian:\n\n.. code:: sh\n\n    $ apt-get install python-lxml\n\nInstall the code:\n\n.. code:: sh\n\n    $ pip install -U pip\n    $ pip install pip-tools\n    $ pip-sync requirements.txt\n\nDevelopment\n===========\n\nInstall development environment:\n\n.. code-block:: sh\n\n    $ pip install -r requirements-dev.txt\n\nCreate necessary database & tables:\n\n.. code-block:: sh\n\n    (openkongqi)$ python -c \"import openkongqi.bin; openkongqi.bin.okq_init()\"\n\nRun celery:\n\n.. code-block:: sh\n\n    (openkongqi)$ python openkongqi/bin.py worker --loglevel=debug --concurrency=1 --autoreload -B\n\nTest\n----\n\nTest the package:\n\n.. code-block:: sh\n\n\n    $ python -m unittest discover\n\nAutomatic testing in various environments:\n\n.. code-block:: sh\n\n    $ tox\n\nVersioning\n----------\n\nOpenkongqi tries to follow the `PEP 440\n<https://www.python.org/dev/peps/pep-0440/#public-version-identifiers>`_ /\n`Semver <http://semver.org/>`_ conventions as defined by `PyPA\n<https://packaging.python.org/en/latest/distributing/#choosing-a-versioning-scheme>`_\n\nTo update the version of the package, use the following command:\n\n.. code-block:: sh\n\n    $ bumpr -b -p\n\nPackaging\n---------\n\nCreate packages:\n\n.. code-block:: sh\n\n    $ python setup.py sdist bdist_wheel\n\nPush package:\n\n.. code-block:: sh\n\n    $ twine upload dist/*\n    $ twine upload -r pypi dist/*\n\nName origin\n===========\n\nK\u014dngq\u00ec (\u7a7a\u6c14) is the Chinese word for air/atmosphere.\n\nLicense\n=======\n\nThis software is licensed under the Apache License 2.0. See the LICENSE file in the top distribution directory for the full license text.\n\n\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Outdoor air quality data",
    "version": "0.2.12",
    "project_urls": {
        "Homepage": "https://github.com/gams/openkongqi"
    },
    "split_keywords": [
        "air",
        "quality"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "33a63a5cd2ef6a5220f3c45cefea13a23a161387825e750e6396128cfd24b8b9",
                "md5": "b258dd6b1bb5ccb5c65ecca5983c51bf",
                "sha256": "102470bbc8c5b407e3b5a96a9cbb4b3619c370f393a9018e3baf7a9f11cb677d"
            },
            "downloads": -1,
            "filename": "openkongqi-0.2.12-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b258dd6b1bb5ccb5c65ecca5983c51bf",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 34077,
            "upload_time": "2023-12-04T05:28:29",
            "upload_time_iso_8601": "2023-12-04T05:28:29.451745Z",
            "url": "https://files.pythonhosted.org/packages/33/a6/3a5cd2ef6a5220f3c45cefea13a23a161387825e750e6396128cfd24b8b9/openkongqi-0.2.12-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fe4e3c1ce13c1a5748c581e13321ad26175a9e9ed82145ae29fb1427116a70d9",
                "md5": "438aed673dc7a2f9405a0d65218070ca",
                "sha256": "d1ebff8835a6859f5d503ccd9985ae183ffffced65501c9f8fe0604582ff8cb2"
            },
            "downloads": -1,
            "filename": "openkongqi-0.2.12.tar.gz",
            "has_sig": false,
            "md5_digest": "438aed673dc7a2f9405a0d65218070ca",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 24358,
            "upload_time": "2023-12-04T05:28:31",
            "upload_time_iso_8601": "2023-12-04T05:28:31.597977Z",
            "url": "https://files.pythonhosted.org/packages/fe/4e/3c1ce13c1a5748c581e13321ad26175a9e9ed82145ae29fb1427116a70d9/openkongqi-0.2.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-04 05:28:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gams",
    "github_project": "openkongqi",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "tox": true,
    "lcname": "openkongqi"
}
        
Elapsed time: 0.14946s