No project description provided
Project description
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
- 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 >= 0.6
- 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
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
Built Distribution
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 pyteleinfo-0.3.0.tar.gz.
File metadata
- Download URL: pyteleinfo-0.3.0.tar.gz
- Upload date:
- Size: 107.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79aedf770ce222d99b72f03a388af9995777df7f71044b083548bfd15191edf3
|
|
| MD5 |
be2ac59bad59f58c968f222b059e59db
|
|
| BLAKE2b-256 |
65c99a1190a2c817537d1e12cc77c6981be81cf76da576acae561d1e3b899a1b
|
Provenance
The following attestation bundles were made for pyteleinfo-0.3.0.tar.gz:
Publisher:
publish.yml on esciara/pyteleinfo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyteleinfo-0.3.0.tar.gz -
Subject digest:
79aedf770ce222d99b72f03a388af9995777df7f71044b083548bfd15191edf3 - Sigstore transparency entry: 1195235101
- Sigstore integration time:
-
Permalink:
esciara/pyteleinfo@32dcf36a7cb9369d381aff14b4200bc165e1fb64 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/esciara
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@32dcf36a7cb9369d381aff14b4200bc165e1fb64 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyteleinfo-0.3.0-py3-none-any.whl.
File metadata
- Download URL: pyteleinfo-0.3.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
328fbc1c1d248209f4852ccf1cc1c137210fb04ff65c19fcd568079864c2d56a
|
|
| MD5 |
5e974127f4bef374f8342cd979dd319a
|
|
| BLAKE2b-256 |
ef9d37e5f3d20458bdbf0ec4e59ae5e1bd8eb9352d6447e43c0762165b5ed461
|
Provenance
The following attestation bundles were made for pyteleinfo-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on esciara/pyteleinfo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyteleinfo-0.3.0-py3-none-any.whl -
Subject digest:
328fbc1c1d248209f4852ccf1cc1c137210fb04ff65c19fcd568079864c2d56a - Sigstore transparency entry: 1195235108
- Sigstore integration time:
-
Permalink:
esciara/pyteleinfo@32dcf36a7cb9369d381aff14b4200bc165e1fb64 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/esciara
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@32dcf36a7cb9369d381aff14b4200bc165e1fb64 -
Trigger Event:
release
-
Statement type: