Skip to main content

SqlAlchemy/Superset libraries.

Reason this release was yanked:

deprecated

Project description

QuestDB Connect

This module offers an implementation of QuestDB's dialect for SQLAlchemy, as well as an engine specification for Apache Superset, using psycopg2 for database connectivity.

Psycopg2 is a widely used and trusted Python module for connecting to and working with PostgreSQL databases. It provides a comprehensive set of features for interacting with the PostgreSQL database system.

SQLAlchemy is an open-source SQL toolkit and ORM library for Python. It provides a high-level API for communicating with relational databases, including schema creation and modification, an SQL expression language, and database connection management. The ORM layer abstracts away the complexities of the database, allowing developers to work with Python objects instead of raw SQL statements.

Apache Superset is a popular open-source business intelligence web application that enables users to visualize and explore data through customizable dashboards and reports. It provides a rich set of data visualizations, including charts, tables, and maps.

Requirements

  • Python from 3.8.x to 3.10.x
  • Psycopg2
  • SQLAlchemy

Installation

You can install this package using pip:

pip install questdb-connect

Sample Usage

Use the QuestDB dialect by specifying it in your SQLAlchemy connection string, from that point on use SQLAlchemy:

import datetime
import os

os.environ.setdefault('SQLALCHEMY_SILENCE_UBER_WARNING', '1')

import questdb_connect.dialect as qdbc
from sqlalchemy import Column, MetaData, create_engine, insert
from sqlalchemy.orm import declarative_base

Base = declarative_base(metadata=MetaData())


class Signal(Base):
    __tablename__ = 'signal'
    __table_args__ = (qdbc.QDBTableEngine('signal', 'ts', qdbc.PartitionBy.HOUR, is_wal=True), )
    source = Column(qdbc.Symbol)
    value = Column(qdbc.Double)
    ts = Column(qdbc.Timestamp, primary_key=True)


def main():
    engine = create_engine('questdb://localhost:8812/main')
    try:
        Base.metadata.create_all(engine)
        with engine.connect() as conn:
            conn.execute(insert(Signal).values(
                source='coconut',
                value=16.88993244,
                ts=datetime.datetime.utcnow()
            ))
    finally:
        if engine:
            engine.dispose()


if __name__ == '__main__':
    main()

Contributing

This package is open-source, contributions are welcome. If you find a bug or would like to request a feature, please open an issue on the GitHub repository. Have a look at the instructions for developers if you would like to push a PR.

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

questdb-connect-0.0.54.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

questdb_connect-0.0.54-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file questdb-connect-0.0.54.tar.gz.

File metadata

  • Download URL: questdb-connect-0.0.54.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for questdb-connect-0.0.54.tar.gz
Algorithm Hash digest
SHA256 51913b6669ead4c5d182f4c321ff88da24f2894b90be96e09d44bafccee0b7d2
MD5 d0f7ed11a7fdce0c2491076b44c1750b
BLAKE2b-256 b17f88274140e838298f1ac4f345a2732e0784e90bacc9b04523c479db2d75d6

See more details on using hashes here.

File details

Details for the file questdb_connect-0.0.54-py3-none-any.whl.

File metadata

File hashes

Hashes for questdb_connect-0.0.54-py3-none-any.whl
Algorithm Hash digest
SHA256 7996ee1a646a536c4e15305b9220b1d06d2a81694e6040426dec2aa72726dcf5
MD5 a5dccbb1ea21817cffda2d2c86658ff4
BLAKE2b-256 13cc7ebfd79e43c61f9f48e28fe0da449ee774832393466e62dce4e84aa4e4b6

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