Skip to main content

A Uniform Interface for Timeseries Database Python Library.

Project description

onetsdb

A Uniform Interface for Timeseries Database Python Library. Will Support MongoDB, InfluxDB, SQLITE3 etc.

Install

 pip install onetsdb

Usage

from onetsdb import connect, TSDBPoint

# tsdb = connect('mongodb://localhost/tsdb')
# tsdb = connect('influxdb://localhost/tsdb')
# tsdb = connect('sqlite3://localhost/tmp/tsdb.sqlite3')  # file: with/tmp/tsdb.sqlite3,
# tsdb = connect('tslite://localhost/tmp/tslite/test')  # tslite
tsdb = connect('sqlite3://localhost/file::memory:')  # with memory sqlite3

tsdb.register_table('device', {
    'tags': {   # Tags can be a filter for querying
        'devid': 'string',  # Device ID
    },
    'fields': {
        'temp': 'float',  # Temperature value
        'humi': 'float',  # humidity value
    }
})
tsdb.write_point('device', TSDBPoint(data={'devid': 'A1', 'temp': 23.5, 'humi': 45.5}))
tsdb.write_point('device', TSDBPoint(data={'devid': 'A2', 'temp': 20.2, 'humi': 35}))
tsdb.write_point('device', TSDBPoint(data={'devid': 'A1', 'temp': 24.5, 'humi': 50}))

print tsdb.query('device').filter(devid='A1').all()

Click to view more information!

CHANGES

1.0.0

  • first version

1.2.0

  • support mongodb, influxdb, sqlite3

1.2.4

  • fix sqlite3 bug

1.3.0

  • support tslite

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

onetsdb-1.3.0.tar.gz (7.4 kB view details)

Uploaded Source

File details

Details for the file onetsdb-1.3.0.tar.gz.

File metadata

  • Download URL: onetsdb-1.3.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.16

File hashes

Hashes for onetsdb-1.3.0.tar.gz
Algorithm Hash digest
SHA256 bedcbb6e3d94e584f5e5a40db74b60d3cd502db3e3401c8bed85c1efb732e86f
MD5 a3b8878597aed3aeb337c753b858cd91
BLAKE2b-256 e60294aa68b009cfc3c538197549feb7ea341c5a18cae40b979d5383dbf904b2

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