Skip to main content

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

1.3.1

  • mongodb support time_group, values and aggregate oprations

Metadata

Release files for onetsdb 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onetsdb 1.3.1
File Size Uploaded
onetsdb-1.3.1.tar.gz 8.1 kB Details

Release files / onetsdb-1.3.1.tar.gz

Download URL onetsdb-1.3.1.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9592ae7d74eb8b6dbda83de1a6d7f455e130677374bba219bd5f91dc85aadaca
BLAKE2b-256 checksum
How to use checksums
9ea0207ec2007390b67fe67171b8d8c31e856ec68f3656a485fa8291312a8b2c
Upload date
Uploaded using Trusted Publishing?
What is 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.18

Release history Release notifications | RSS feed

This release

1.3.1 This release

1 release file

1.3.0

1 release file

1.2.6

1 release file

1.2.4

1 release file

1.2.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page