Skip to main content

Mireo SpaceTime database connector

Project description

Mireo SpaceTime database remote connector

stdb-driver is a Python module for managing remote Mireo SpaceTime database.

Features

  • Both blocking and asynchronous modes of operation are available.
  • Supports listing nodes; listing, creating and droping tables; inserting rows; and performing range queries.
  • Range query results are convertible to Python lists, NumPy arrays and Pandas dataframes.
  • Requires CPython 3.10+.
  • Available for Linux (glibc 2.17+ and musl 1.2+; x86-64) and Windows (x86-64).

Installation

pip install -U stdb-driver -i https://pypi.mireo.local

Conversions to NumPy and Pandas data types require those packages that can be installed as optional dependencies:

pip install -U stdb-driver[numpy]
pip install -U stdb-driver[pandas]
pip install -U stdb-driver[all]

Example

import stdb_driver

# Connect
session = stdb_driver.SessionConfig().zk_hosts(<address>).build()
print(session.status())  # SessionStatus.Connected

# List nodes and tables
print(session.list_nodes(), session.list_tables())

# Run range query
RALL = stdb_driver.RANGE_ALL
res = session.range_query('segment', [[(1, 10000), RALL, RALL, RALL, RALL, RALL, RALL, RALL, RALL]])

# Print column names and their MSQL data types
print(res.row_type.columns)

# Iterating over rows converts each lazily to a Python list of appropriate Python data types
for row in res:
	print(row)

# Query result can be converted to:
rows = res.to_list()  # Python list of appropriate Python data types
arr = res.to_numpy()  # NumPy array of appropriate NumPy data types (requires numpy)
df = res.to_pandas()  # Pandas dataframe of appropriate NumPy/Pandas data types (requires pandas)

# Disconnect
session.stop()
print(session.status())  # SessionStatus.Stopped

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 Distributions

If you're not sure about the file name format, learn more about wheel file names.

stdb_driver-0.3.2-cp310-abi3-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.10+Windows x86-64

stdb_driver-0.3.2-cp310-abi3-musllinux_1_2_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

stdb_driver-0.3.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

File details

Details for the file stdb_driver-0.3.2-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for stdb_driver-0.3.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a9bfecd9f72cb83495a1d4faf5f0534f8c77d34a2422ab2e17c2aa9f803e0cd8
MD5 2f1ecc502b6bc719537040eefa885edb
BLAKE2b-256 5f6bd361ca554c4b9c02c5395381e83a07e2a6c4ca398dd1cd4dadde6f2d35dd

See more details on using hashes here.

File details

Details for the file stdb_driver-0.3.2-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for stdb_driver-0.3.2-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b02b5ce2a5d3435b9342c74662ea997ef7bd9a0de99d7e5ce60e5eded5111a42
MD5 ec865c8fd6bd6212a34d62212180b1f6
BLAKE2b-256 9e0f6482ebf158afd734708be222b73f91e116ebd86b8ca5bb5b50ca6ac9749c

See more details on using hashes here.

File details

Details for the file stdb_driver-0.3.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for stdb_driver-0.3.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7e957fd7718501afb641ddc6c21c198e7790f4fe86f4661a3666b2d0c6b4d133
MD5 9a9f20d1df2d34aaee55d25a06702fe6
BLAKE2b-256 495a15a500f077505945e1dd7543be6ec359e065c0bf16483f225c6c308b491c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page