Timeplus API Python SDK
Timeplus Python SDK
to install the sdk, run pip install timeplus
import os
from rx import operators as ops
from timeplus import Stream, StreamColumn, Query, Env, Type
# initialize timeplus environment
api_key = os.environ.get("TIMEPLUS_API_KEY")
env = (
Env().schema("https").host("hostname").port("443").tenant("tenant").api_key(api_key)
)
Env.setCurrent(env)
# create a stream
s = (
Stream()
.name("stream_name")
.column(StreamColumn().name("field_name_a").type(Type.String))
.column(StreamColumn().name("field_name_b").type(Type.Float))
)
s.create()
# insert data into stream
s.insert(
[
[
"hello",
100.1
],
[
"timeplus",
20.2
],
]
)
# delete stream
s.delete()
# run query on existing stream
query = Query().sql(f"select * from stream_name")
query.create()
query.get_result_stream().pipe(ops.take(5)).subscribe(
on_next=lambda i: print(f"get one query result {i}"),
on_error=lambda e: print(f"error {e}"),
on_completed=lambda: query.stop(),
)
Metadata
Release files for timeplus 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| timeplus-0.2.0.tar.gz | 283.5 kB | Without provenance | Details for timeplus-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| timeplus-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for timeplus-0.2.0-py3-none-any.whl |
Total release size: 299.3 kB
Release files / timeplus-0.2.0.tar.gz
| Download URL | timeplus-0.2.0.tar.gz |
|---|---|
| Size | 283.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9414f08d3a86f019fc679de761eb70003bc67d04c75d4b28ea1df4b535195859
|
|
BLAKE2b-256 checksum How to use checksums |
79b50895953b07d59942b60732d3646063a244f2442261ff18eaa5211e020a71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.7
|
Release files / timeplus-0.2.0-py3-none-any.whl
| Download URL | timeplus-0.2.0-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d3583d9c7cbe95bde642b54861629788b9c3c0bde4e73e95893b55bdccfd1b2c
|
|
BLAKE2b-256 checksum How to use checksums |
6efe0b6c171c5a1963ca7edc306e67e6c7fe2a6db2678e1378eb45aab27d9f43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.7
|
Security for timeplus 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.