Skip to main content

A standalone, host-agnostic Python library for KNX telegram persistence.

Project description

knx-telegram-store

A standalone, host-agnostic Python library for KNX telegram persistence.

Features

  • Canonical Data Model: A unified model for KNX telegrams shared between Home Assistant and SpectrumKNX.
  • Pluggable Backends:
    • In-Memory: Fast, deque-based storage with full filtering support.
    • SQLite: Lightweight persistent storage with SQL-based filtering.
    • PostgreSQL + TimescaleDB: Full-scale time-series storage.
  • Unified Query Model: Powerful declarative filtering including time-delta context windows and pagination.
  • Zero Runtime Dependencies: Core library (model, interface, in-memory) has no dependencies.
  • Automated Schema Management: SQL backends handle their own creation and upgrades.

Installation

pip install knx-telegram-store

For SQL support:

pip install knx-telegram-store[sqlite]
pip install knx-telegram-store[postgres]

Usage

from datetime import datetime
from knx_telegram_store import StoredTelegram, TelegramQuery
from knx_telegram_store.backends.memory import MemoryStore

async def main():
    store = MemoryStore(max_size=1000)
    await store.initialize()

    telegram = StoredTelegram(
        timestamp=datetime.now(),
        source="1.1.1",
        destination="1/1/1",
        telegramtype="GroupValueWrite",
        direction="Incoming",
        value=22.5,
        unit="°C"
    )

    await store.store(telegram)

    query = TelegramQuery(destinations=["1/1/1"])
    result = await store.query(query)
    
    for t in result.telegrams:
        print(f"{t.timestamp}: {t.source} -> {t.destination} | {t.value} {t.unit}")

    await store.close()

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

knx_telegram_store-0.1.2.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

knx_telegram_store-0.1.2-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file knx_telegram_store-0.1.2.tar.gz.

File metadata

  • Download URL: knx_telegram_store-0.1.2.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for knx_telegram_store-0.1.2.tar.gz
Algorithm Hash digest
SHA256 11d9064e0d4a6e6d9b7d163ecc0eaff0fcade5eb449d1efc102d5d635a9d8ca7
MD5 73b924e81b96225c754200eacc58e673
BLAKE2b-256 dd88b5f3b623ac9dd6e9ff9435d691979cdd7a31893a43a5ceaca87bd057bef1

See more details on using hashes here.

Provenance

The following attestation bundles were made for knx_telegram_store-0.1.2.tar.gz:

Publisher: publish.yml on XKNX/knx-telegram-store

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file knx_telegram_store-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for knx_telegram_store-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 67a46cb876571ed23b82805d3ad8fd6f490abec42a7ca132cb83e8a2fb157a9d
MD5 f2b44ec95e0b57d3543cae6750f58a48
BLAKE2b-256 02671f3bfedbf7531930d2ef4be93f9ff01fe528860dad088b889238586f6b78

See more details on using hashes here.

Provenance

The following attestation bundles were made for knx_telegram_store-0.1.2-py3-none-any.whl:

Publisher: publish.yml on XKNX/knx-telegram-store

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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