pyteleinfo
A Python library for decoding and encoding ENEDIS teleinfo frames - implementation of the tele-information communication frames specifications for French electronic electricity meters.
Features
- Decode teleinfo frames from French ENEDIS electricity meters
- Encode data back to teleinfo format
- Read frames from serial port with configurable settings
- Async I/O support with pyserial-asyncio-fast
- Comprehensive exception handling
- Pydantic-based settings with environment variable support
Installation
pip install pyteleinfo
Quick Start
Decoding Teleinfo Frames
from teleinfo import decode
# Decode a raw teleinfo frame (bytes or string)
raw_frame = b'\x02\nADCO 050022120078 2\r\nOPTARIF HC.. <\r\x03'
decoded = decode(raw_frame)
print(decoded)
# [{'label': 'ADCO', 'data': '050022120078'}, {'label': 'OPTARIF', 'data': 'HC..'}]
Reading from a Serial Port
from teleinfo import read_frame, decode
# Read a complete frame from the serial port
raw = read_frame("/dev/ttyUSB0")
decoded = decode(raw)
print(decoded)
Settings can be customized via the TeleinfoSettings class or environment variables
(prefixed with TELEINFO_, e.g. TELEINFO_BAUDRATE=1200):
from teleinfo.settings import TeleinfoSettings
settings = TeleinfoSettings(baudrate=9600, timeout=10.0)
raw = read_frame("/dev/ttyUSB0", settings=settings)
Requirements
- Python >= 3.12
- pyserial >= 3.5
- pyserial-asyncio-fast
- pydantic-settings >= 2.13.1
Development
# Install uv if not already installed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and setup
git clone https://github.com/esciara/pyteleinfo.git
cd pyteleinfo
uv sync --group dev
# Run tests
uv run pytest
# Lint and format
uv run ruff check .
uv run ruff format .
# Type checking
uv run mypy src
License
BSD 3-Clause License - Copyright (c) 2019 Emmanuel Sciara
See LICENSE file for details.
Links
- GitHub Repository: esciara/pyteleinfo
- PyPI Package: pyteleinfo
- Issue Tracker: GitHub Issues
Release files for pyteleinfo 0.4.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 | |
|---|---|---|---|
| pyteleinfo-0.4.0.tar.gz | 111.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyteleinfo-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 124.1 kB
Release files / pyteleinfo-0.4.0.tar.gz
| Download URL | pyteleinfo-0.4.0.tar.gz |
|---|---|
| Size | 111.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8a231d158f8fbd3c5ac132305c6ba10a25319658cf5e5736f840131d6467bf1
|
|
BLAKE2b-256 checksum How to use checksums |
09695f2b1d737ba51ab4f181aea356996e0c416ed24134d59bf31d673beb8528
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 6, 2026.
Transparency logRelease files / pyteleinfo-0.4.0-py3-none-any.whl
| Download URL | pyteleinfo-0.4.0-py3-none-any.whl |
|---|---|
| Size | 12.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
44f785f3123550446552ccb99ce81ec4d6443ad1b93e6c304102e87765ae3d79
|
|
BLAKE2b-256 checksum How to use checksums |
e7d0958fb79e416f8dd7ee7ca7467dc69cabfd053e2249a0acaca71150c65559
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 6, 2026.
Transparency log