Timeplus python SDK
Project description
Timeplus API Python SDK
Timeplus Python SDK
to install the sdk, run pip install timeplus
from rx import operators as ops
from timeplus import Stream, StreamColumn, Query, Env
# initialize timeplus environment
token = os.environ.get("AUTH0_API_TOKEN")
env = (
Env().schema("https").host("hostname").port("443").token(token)
)
Env.setCurrent(env)
# create a stream
s = (
Stream()
.name("stream_name")
.column(StreamColumn().name("field_name_a").type("string"))
.column(StreamColumn().name("field_name_b").type("float64"))
)
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(),
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
timeplus-0.1.3.tar.gz
(282.5 kB
view details)
Built Distribution
timeplus-0.1.3-py3-none-any.whl
(14.0 kB
view details)
File details
Details for the file timeplus-0.1.3.tar.gz
.
File metadata
- Download URL: timeplus-0.1.3.tar.gz
- Upload date:
- Size: 282.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e2d1323eadcc2320b7ea5c9dae06c463128239aa665e04ee18995257dade818 |
|
MD5 | 8f9803525e75cf9a2155abc4f6ebe347 |
|
BLAKE2b-256 | 9ae67896fbb4e3447074d785f658fe5a56b952d4d71066e4e22bdd1ba54be613 |
Provenance
File details
Details for the file timeplus-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: timeplus-0.1.3-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cc7158361ad861591234d2ae47de8804f795a23a17801e4e2d153da979cd26d |
|
MD5 | 53faef10c6e53fd51d4ae8667de8c8ec |
|
BLAKE2b-256 | 7436a41571d3bd0281ef9134badd19ef92a6b9e343a449b1b3226a665e7ea0c2 |