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
api_key = os.environ.get("TIMEPLUS_API_KEY")
env = (
Env().schema("https").host("hostname").port("443").api_key(api_key)
)
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(),
)
Release files for timeplus 0.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| timeplus-0.1.10.tar.gz | 282.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| timeplus-0.1.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 296.9 kB
Release files / timeplus-0.1.10.tar.gz
| Download URL | timeplus-0.1.10.tar.gz |
|---|---|
| Size | 282.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0cd7390257da4307883099cc3439bb5e856cc4a507d4b8c73b06de4082e6225b
|
|
BLAKE2b-256 checksum How to use checksums |
a649c2cb299ad9e4661f85355105959be4f9dc8586eafecc119cbcc1d379923b
|
| 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.1.10-py3-none-any.whl
| Download URL | timeplus-0.1.10-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85ebb6c4058c0ba9f318ae2bd2c6f73c4f4b0cd529f826b6b9fa583354ae2def
|
|
BLAKE2b-256 checksum How to use checksums |
dd439f336cde7260b091806d0b6bde6e5ca65dc837c7450309f22eea2e2e00e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.7
|