Skip to main content

Outdoor air quality data

Project description

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.

Development

Install development environment:

$ pip install -r dev_requirements.txt

Create necessary database & tables:

(openkongqi)$ python -c "import openkongqi.conf; openkongqi.conf.recsdb.init()"

Run celery:

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

Test

Test the package:

$ python -m unittest discover

Automatic testing in various environments:

$ tox

Versioning

Openkongqi tries to follow the PEP 440 / Semver conventions as defined by PyPA

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

$ bumpr -b -m

Packaging

Create packages:

$ python setup.py sdist bdist_wheel

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openkongqi-0.0.3.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

openkongqi-0.0.3-py2.py3-none-any.whl (21.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file openkongqi-0.0.3.tar.gz.

File metadata

  • Download URL: openkongqi-0.0.3.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for openkongqi-0.0.3.tar.gz
Algorithm Hash digest
SHA256 a8cfc6fe9c3d2906fceb0a4d89cdf1aa64e8335a9394d1d58b6b4d2edfc3dff4
MD5 46de686616ce43b2e43e61a4984437ac
BLAKE2b-256 1065a3790fdd6f938901113e5f353670437812c26a4a2c627a78b2e561ce104e

See more details on using hashes here.

File details

Details for the file openkongqi-0.0.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for openkongqi-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d29e55713db31471ec8085d639c199be6689efd4c9df406f71e4b77717a8891b
MD5 97eb35ffdaf4ee05635e5b1719a24e9d
BLAKE2b-256 7e823af3b4fff7a8822a8527ad0be9036b5e8cf0ce395da205d67baa8e981c34

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page