A SQLAlchemy dialect for TimescaleDB
Project description
SQLAlchemy TimescaleDB
This is the TimescaleDB dialect driver for SQLAlchemy.
Install
$ pip install sqlalchemy_timescaledb
Usage
Adding to table timescaledb_hypertable
option allows you to configure the hypertable parameters:
import datetime
from sqlalchemy import create_engine, MetaData
from sqlalchemy import Table, Column, Integer, String, DateTime
engine = create_engine('timescaledb://user:password@0.0.0.0:8001/database')
metadata = MetaData()
metadata.bind = engine
Metric = Table(
'metric', metadata,
Column('name', String),
Column('value', Integer),
Column('timestamp', DateTime(), default=datetime.datetime.now),
timescaledb_hypertable={
'time_column_name': 'timestamp'
}
)
metadata.create_all(engine)
Currently only psycopg2
driver is supported.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for sqlalchemy_timescaledb-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 258dd4d0c1d568e2dbe96ca779cf641b7c3823566af90a2e507d00fcee991e38 |
|
MD5 | 2aef4d73046199c14f55907779b43ab4 |
|
BLAKE2b-256 | 4414656b8dca70f7926a1a46337ee781d5d24f65b0dd3b3d7764265a741b49b4 |