Skip to main content

A query generator for the SQL dialect of the Influx Query Language (InfluxQL)

Project description

https://github.com/daq-tools/pyinfluxql/workflows/Tests/badge.svg https://img.shields.io/pypi/pyversions/pyinfluxql.svg https://img.shields.io/pypi/v/pyinfluxql.svg https://img.shields.io/pypi/dm/pyinfluxql.svg https://img.shields.io/pypi/status/pyinfluxql.svg https://img.shields.io/pypi/l/pyinfluxql.svg

About

A query generator for the SQL dialect of the Influx Query Language (InfluxQL). Like SQLAlchemy but for InfluxDB. Consider this an experimental WIP.

Synopsis

from influxdb import InfluxDBClient
from pyinfluxql import Engine, Query, Mean

client = InfluxDBClient('localhost', 8086, 'root', 'root', 'example')
engine = Engine(client)
query = Query(Mean('value')).from_('cpu_load') \
    .where(time__gt=datetime.now() - timedelta(1))
    .group_by(time=timedelta(hours=1))
engine.execute(query)

Tests

How to invoke the test suite.

Using Tox

Run InfluxDB within Docker:

docker run -it --rm --publish 8086:8086 influxdb:1.8.3

Run tox:

tox

Using sandbox

Alternatively, setup package in development mode:

python3 -mvenv .venv
source .venv/bin/activate
pip install --editable=.[test]

Run pytest:

py.test tests -vvv

Download files

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

Source Distribution

pyinfluxql-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

File details

Details for the file pyinfluxql-0.1.0.tar.gz.

File metadata

  • Download URL: pyinfluxql-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.9.1

File hashes

Hashes for pyinfluxql-0.1.0.tar.gz
Algorithm Hash digest
SHA256 719c584da63df5b28ca1d4a625641ab4542269a6995f1b4a26e7c2468dbd0fa8
MD5 5a08fa252b7b5045421599cf4e8c1b87
BLAKE2b-256 2e17053dcd6eeaa693381e488c63b68e5e1efc16a25a29c34c5572a08279e56d

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