NanoTS (Community Edition) Python bindings
Project description
nanots (Python)
Python bindings for NanoTS (Community Edition).
Build (local)
cd python/nanots-py
maturin develop --release
python -c "import nanots; print(nanots.__version__)"
Arrow zero-copy export
Db.query_table_range_arrow_capsules(...) returns (array_capsule, schema_capsule) compatible with:
import pyarrow as pa
schema_capsule, array_capsule = db.query_table_range_arrow_capsules("sensor", t1, t2)
struct_arr = pa.Array._import_from_c(array_capsule, schema_capsule)
# struct_arr is a StructArray with fields: ts_ms + schema columns
table = pa.Table.from_struct_array(struct_arr)
For best throughput, prefer Arrow export over Python object conversion.
If your PyArrow supports it, you can also do:
import pyarrow.lib
schema_capsule, array_capsule = db.query_table_range_arrow_capsules("sensor", t1, t2)
batch = pyarrow.lib.RecordBatch._import_from_c_capsule(schema_capsule, array_capsule)
Arrow batch append
import pyarrow as pa
import nanots
db = nanots.Db("data/test.ntt")
batch = pa.record_batch(
[
pa.array([1000, 1001, 1002], type=pa.int64()),
pa.array([1.0, 2.0, 3.0], type=pa.float64()),
],
names=["ts_ms", "value"],
)
schema_capsule, array_capsule = batch.__arrow_c_array__()
db.append_rows_arrow_capsules("sensor", schema_capsule, array_capsule)
Notes:
- This path uses a batch append internally (columnar), avoiding per-row Python/Rust overhead.
- Column names must match the table schema; include all columns in order.
- For Float64-only tables,
ts_ms+ all value columns must be present.
Auto maintenance options
db = nanots.Db(
"data/test.ntt",
auto_maintenance={
"wal_target_ratio": 2,
"wal_min_bytes": 32 * 1024 * 1024,
"target_segment_points": 8192,
"check_interval_ms": 5000,
"retention_check_interval_ms": 60000,
"max_writes_per_sec": 100000,
"write_load_window_ms": 5000,
"min_idle_ms": 1000,
"max_segments_per_pack": 64,
},
)
Diagnose
import nanots
db = nanots.Db("data/test.ntt")
print(db.diagnose())
Power loss simulation
python test_power_loss.py --reset --rounds 20
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 Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nanots_db-0.1.0-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: nanots_db-0.1.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 22.4 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0800b54a29cc7c4e9a55dd37ce4c096f2231a59239c83bd9ececf4744305c5d7
|
|
| MD5 |
1032c5afc65b0b326329700c1350c1ed
|
|
| BLAKE2b-256 |
4b48dfb496e1323b027cfb9230b9f0c5ab393b07aaa9fe1b6b2513e782248f72
|
File details
Details for the file nanots_db-0.1.0-cp312-cp312-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: nanots_db-0.1.0-cp312-cp312-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 25.3 MB
- Tags: CPython 3.12, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fbaf2be1f29f3c8e1771eb5df53a1d3e65b5280c7fcf7c13e69b61f2cd5dc34
|
|
| MD5 |
014bfe2466de2602a0a9df5e7e00fec3
|
|
| BLAKE2b-256 |
46982bc2f77166d1071f709e63f665073113f5f2dd209afddcb2bea34af002d9
|
File details
Details for the file nanots_db-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: nanots_db-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 22.4 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5be2170abd01dca344b02de727d5137339202eaf7ff46af6cc253d2279b9caf4
|
|
| MD5 |
4348faf9705ecfd3d5da02a2feaa03e0
|
|
| BLAKE2b-256 |
c2a17100f3cfbda6720b0d19122a7cef4e74e86a6d333269745ff0923d9756b0
|
File details
Details for the file nanots_db-0.1.0-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: nanots_db-0.1.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 22.4 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79926b20fe6f60a1e3680557387b0aed32e2df51bb081590b38ae3e436f8ffaa
|
|
| MD5 |
762bc4115ff5519cdb487c4a3dc6b483
|
|
| BLAKE2b-256 |
96c16a0552637b4b20963bcf5c24a18cd4dd07efb5950f1d1ffc454d2a5ac533
|
File details
Details for the file nanots_db-0.1.0-cp311-cp311-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: nanots_db-0.1.0-cp311-cp311-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 25.3 MB
- Tags: CPython 3.11, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32eef5390517983fc40441e56366d007173203274e77828df49ff3c6c4d67979
|
|
| MD5 |
ad2175325ee73fbd52dffb71b6331085
|
|
| BLAKE2b-256 |
db0ca7502e025655e0b8d6e004fb7b160e963780de77fd087987af1dbcd96676
|
File details
Details for the file nanots_db-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: nanots_db-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 22.4 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a03f143a44b15bc39c85531f6c49f81c6d2138f6c5b2347386db11473df8a0b6
|
|
| MD5 |
0351bf4db5581f725fc08b8b03b80a1e
|
|
| BLAKE2b-256 |
771929c43963072a477d433fe6a9a3ab0833d3297f753a1fb9ff41f63413a804
|
File details
Details for the file nanots_db-0.1.0-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: nanots_db-0.1.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 22.4 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52400b334b1a3c9633b467df9cca39c489361ff61339010dcf8ee2519c96fc9b
|
|
| MD5 |
8363d52fe266ef2dcf480f8568028db0
|
|
| BLAKE2b-256 |
014462b122ac60adee01a042bd44aad650167efd7bcdc4ec9050ab84283ae8bd
|
File details
Details for the file nanots_db-0.1.0-cp310-cp310-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: nanots_db-0.1.0-cp310-cp310-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 25.3 MB
- Tags: CPython 3.10, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
158cb7c8e23168fe06636288a177e681c3616704665e3a6d9d4b68566cbd511f
|
|
| MD5 |
a168c5978bc7eca5aa409be3d0915f5b
|
|
| BLAKE2b-256 |
7c81741851840d58e816029233b9d5f073d436fb6cfdb7dfad3ce1c0ed35497c
|
File details
Details for the file nanots_db-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: nanots_db-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 22.4 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4a2bce30efb19a4a16927699ec3670c4c1a4542b62ef2735ad00f74b96bde86
|
|
| MD5 |
de1a7934273731acd056a58d94d8f152
|
|
| BLAKE2b-256 |
9db62d152ac73a1b8f07f8c70259a65de46b02df58fbcf3063c8cf982e9c72ea
|
File details
Details for the file nanots_db-0.1.0-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: nanots_db-0.1.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 22.4 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55cf84ab03e05a00ab6cee7026330b66d22c696020548a86c9257c75ed7f1ebf
|
|
| MD5 |
9dd84d0b7973997eb0d4f26237c98df8
|
|
| BLAKE2b-256 |
c3b816a821c29c244293f22e7b2f0c309d3fc402647bf4fe8d35951e6d459cd9
|
File details
Details for the file nanots_db-0.1.0-cp39-cp39-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: nanots_db-0.1.0-cp39-cp39-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 25.3 MB
- Tags: CPython 3.9, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edcc18ad6b1ed3fc106fafa2806784c158ed51ec06fca01d309e8f267ee10746
|
|
| MD5 |
4a3d1818e3dcc69511f2030fa407d5e7
|
|
| BLAKE2b-256 |
5e6175509c69d93b34044c180d221b6151512c00014c805f80b96bb72fac715f
|
File details
Details for the file nanots_db-0.1.0-cp39-cp39-macosx_11_0_arm64.whl.
File metadata
- Download URL: nanots_db-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 22.4 MB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86b8bb09246dae76065a8310b5f2fc9d08c5277df1ee0709074fcbff8fc8abcc
|
|
| MD5 |
62402cd071852d210bcfb70d7fbe7081
|
|
| BLAKE2b-256 |
39ff7103bbfbc6e4eedcb31c927ee53f1ea783927e3897ecdd9ecab6089c1955
|