A library to gather information from ETS project files used for KNX
Project description
(X)KNX Project
Extracts KNX projects and asynchronously parses the underlying XML.
This project aims to provide a library that can be used to extract and parse KNX project files and read out useful information including the group addresses, devices and their descriptions and possibly more.
Documentation
Currently, xknxproject supports extracting (password protected) ETS5 and ETS6 files and can obtain the following information from your project:
- Areas, Lines, Devices and their individual address
- CommunicationObjectInstance references for their devices (GA assignments)
- Group Addresses and their DPT type if set
- The application programs communication objects and their respective flags and the DPT Type
- Location information of your devices (in which rooms they are)
Caution: Loading a middle-sized project with this tool takes about 1.5 seconds. For bigger projects this might as well be >3s.
Installation
In order to parse XML and to overcome the performance issues that parsing application programs with over 800k lines of XML has we use lxml. lxml requires libxml2 to be installed in the underlying system. You can read more on their documentation on this topic.
pip install xknxproject
Usage
import asyncio
from xknxproject.models import KNXProject
from xknxproject import KNXProj
async def main():
"""Extract and parse a KNX project file."""
knxproj: KNXProj = KNXProj("path/to/your/file.knxproj", "optional_password")
project: KNXProject = await knxproj.parse()
asyncio.run_until_complete(main())
The KNXProject is a typed dictionary and can be used just like a dictionary, or, exported as JSON.
You can find an example file (exported JSON) in our test suite under https://github.com/XKNX/xknxproject/tree/main/test/resources/stubs
The full type definition can be found here: https://github.com/XKNX/xknxproject/blob/main/xknxproject/models/knxproject.py
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 xknxproject-1.1.0.tar.gz.
File metadata
- Download URL: xknxproject-1.1.0.tar.gz
- Upload date:
- Size: 29.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cbd0d1b1844ed036de03447dac78868bfd9314202c0cfa1b5578ebdd7e38509
|
|
| MD5 |
0351507a518d890728e1ea5e4c34ae1b
|
|
| BLAKE2b-256 |
ed34fd946788f74140319902534cd5e255d402188982d5a8a70b63f2c9a2525f
|
File details
Details for the file xknxproject-1.1.0-py3-none-any.whl.
File metadata
- Download URL: xknxproject-1.1.0-py3-none-any.whl
- Upload date:
- Size: 32.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78ea82077705ed711b0dbfb2cc8e77e0e90c30be6ad8c32e954580d232403c3b
|
|
| MD5 |
12e384a898fc4d63a8521008a536220b
|
|
| BLAKE2b-256 |
6379f77494a7abd5ab4e8f346b20be6c607db2ef975a5475a69cc7e6e7143a9a
|