openkongqi


Nameopenkongqi JSON
Version 0.2.13 PyPI version JSON
download
home_pagehttps://github.com/gams/openkongqi
SummaryOutdoor air quality data
upload_time2024-05-02 07:32:29
maintainerNone
docs_urlNone
authorStefan Berder
requires_pythonNone
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": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "air quality",
    "author": "Stefan Berder",
    "author_email": "stefan@measureofqualty.com",
    "download_url": "https://files.pythonhosted.org/packages/cc/91/c3b51be6fad48165f3828b904e94944f3e58d49c6ba2f9dc8cb79d135842/openkongqi-0.2.13.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.13",
    "project_urls": {
        "Homepage": "https://github.com/gams/openkongqi"
    },
    "split_keywords": [
        "air",
        "quality"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "497b14a3d8180aac89d52e3987188bed73331fd28b940fd9af4905541205185c",
                "md5": "9246beee4d052ab180ba6574c65d7477",
                "sha256": "81925640e18a730ef9081175953ca50af17de7c9fac1296337003ad96859f04b"
            },
            "downloads": -1,
            "filename": "openkongqi-0.2.13-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9246beee4d052ab180ba6574c65d7477",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 34076,
            "upload_time": "2024-05-02T07:32:27",
            "upload_time_iso_8601": "2024-05-02T07:32:27.601222Z",
            "url": "https://files.pythonhosted.org/packages/49/7b/14a3d8180aac89d52e3987188bed73331fd28b940fd9af4905541205185c/openkongqi-0.2.13-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cc91c3b51be6fad48165f3828b904e94944f3e58d49c6ba2f9dc8cb79d135842",
                "md5": "d107ef94859934482078b396b81de384",
                "sha256": "e2a05833858ee9333f3f25f99d0c6841f25820a3386fc95abddba41e853f1eab"
            },
            "downloads": -1,
            "filename": "openkongqi-0.2.13.tar.gz",
            "has_sig": false,
            "md5_digest": "d107ef94859934482078b396b81de384",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 24370,
            "upload_time": "2024-05-02T07:32:29",
            "upload_time_iso_8601": "2024-05-02T07:32:29.480216Z",
            "url": "https://files.pythonhosted.org/packages/cc/91/c3b51be6fad48165f3828b904e94944f3e58d49c6ba2f9dc8cb79d135842/openkongqi-0.2.13.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-02 07:32:29",
    "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.28669s