A lightweight and user-friendly Python wrapper for TimescaleDB/PostgreSQL, designed for time‑series data ingestion, schema management, and convenient querying using SQLAlchemy.
Comes with a full development environment (VS Code Devcontainer + TimescaleDB), automated tests, and deployable Docker images via GHCR.
- High‑level
TimescaleAccessclient for TimescaleDB - Automatic hypertable creation and column inference
- Fast DataFrame inserts with
insert_hypertable()andinsert_hypertable_on_conflict() - Schema and table utilities (
ensure_schema_exists,get_table_names, …) - Advanced SQL analysis helpers:
- Missing/non‑consecutive sequence detection
- Duplicate row detection
- Null summary function generation
- Hypertable size calculations
- Complete test suite using real TimescaleDB (via docker-compose)
- Devcontainer with automated setup for reproducible development
- GHCR-ready runtime Docker image
src/timescale_access/
client.py
engine.py
read.py
write.py
analysis.py
tests/
test_client.py
config.py
conftest.py
docs/
source/
build/
.devcontainer/
docker-compose.yaml
Dockerfile
pyproject.toml
pip install -e .[dev]pip install git+https://github.com/bxvtr/timescale-access.gitdocker pull ghcr.io/bxvtr/timescale-access:latestfrom timescale_access.client import TimescaleAccess
import pandas as pd
from datetime import datetime
db = TimescaleAccess("postgresql://user:pass@localhost:5432/postgres")
# Ensure schema exists
db.ensure_schema_exists("raw_data")
# Insert time-series data
df = pd.DataFrame([{
"instrument_name": "BTC-PERPETUAL",
"trade_seq": 10001,
"timestamp": datetime.utcnow(),
"value": 42.0,
}])
db.insert_hypertable("raw_data", "btc_trades", df)
# Read table back
df_out = db.get_table("raw_data", "btc_trades")
print(df_out)For the full API reference, visit the documentation:
👉 https://bxvtr.github.io/timescale-access/
This project ships with a complete dev environment:
- VS Code Devcontainer (
.devcontainer/) - docker-compose launching a real TimescaleDB instance
- Automatic installation of development dependencies
Start the environment:
Dev Containers: Rebuild and Reopen in Container
pytest
Tests automatically connect to the TimescaleDB instance from docker-compose.
Build locally:
cd docs
make htmlOnline docs:
👉 https://bxvtr.github.io/timescale-access/
Main entry point:
TimescaleAccessinsert_hypertable()insert_hypertable_on_conflict()get_table()get_column_names()get_schemas()get_hypertable_size()get_missing_trade_seq()ensure_schema_exists()- … and more
See the full reference in the documentation.