xknxproject


Namexknxproject JSON
Version 3.8.0 PyPI version JSON
download
home_pageNone
SummaryA library to gather information from ETS project files used for KNX
upload_time2024-09-30 06:57:20
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9.0
licenseGPL-2.0-only
keywords knx ets home assistant
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # (X)KNX Project

[![Pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=f8b424)](https://github.com/pre-commit/pre-commit)
[![Discord](https://img.shields.io/discord/338619021215924227?color=7289da&label=Discord&logo=discord&logoColor=7289da)](https://discord.gg/bkZe9m4zvw)
[![codecov](https://codecov.io/gh/XKNX/xknxproject/branch/main/graph/badge.svg?token=LgPvZpKK3k)](https://codecov.io/gh/XKNX/xknxproject)

Extracts KNX projects and 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, their descriptions and possibly more.

## Documentation

Currently, xknxproject supports extracting (password protected) ETS 4, 5 and 6 projects and can obtain the following information:

* Areas, Lines, Devices and their individual address and channels
* CommunicationObjectInstance references for their devices (GA assignments)
* Group Addresses and their DPT type if set
* The application programs communication objects, their respective flags and the DPT Type
* Location information of devices (in which rooms they are)
* Functions assigned to rooms

Caution: Loading a middle-sized project with this tool takes about 1.5 seconds. For bigger projects this might as well be >3s.

Not all supported languages are included in project / application data. If the configured language is not found, the default language will be used - which is manufacturer / product dependent.

## Installation

`pip install xknxproject`

## Usage

```python
"""Extract and parse a KNX project file."""
from xknxproject.models import KNXProject
from xknxproject import XKNXProj


knxproj: XKNXProj = XKNXProj(
    path="path/to/your/file.knxproj",
    password="password",  # optional
    language="de-DE",  # optional
)
project: KNXProject = knxproj.parse()
```

The resulting `KNXProject` is a typed dictionary and can be used just like a dictionary, or can be 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

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "xknxproject",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9.0",
    "maintainer_email": null,
    "keywords": "KNX, ETS, Home Assistant",
    "author": null,
    "author_email": "Marvin Wichmann <me@marvin-wichmann.de>, Matthias Alphart <farmio@alphart.net>",
    "download_url": "https://files.pythonhosted.org/packages/a0/38/4f6e8e4942858c7586faf6c042fbf13e00b1f4e359bb9f24f7ef9e74008d/xknxproject-3.8.0.tar.gz",
    "platform": null,
    "description": "# (X)KNX Project\n\n[![Pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=f8b424)](https://github.com/pre-commit/pre-commit)\n[![Discord](https://img.shields.io/discord/338619021215924227?color=7289da&label=Discord&logo=discord&logoColor=7289da)](https://discord.gg/bkZe9m4zvw)\n[![codecov](https://codecov.io/gh/XKNX/xknxproject/branch/main/graph/badge.svg?token=LgPvZpKK3k)](https://codecov.io/gh/XKNX/xknxproject)\n\nExtracts KNX projects and parses the underlying XML.\n\nThis 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, their descriptions and possibly more.\n\n## Documentation\n\nCurrently, xknxproject supports extracting (password protected) ETS 4, 5 and 6 projects and can obtain the following information:\n\n* Areas, Lines, Devices and their individual address and channels\n* CommunicationObjectInstance references for their devices (GA assignments)\n* Group Addresses and their DPT type if set\n* The application programs communication objects, their respective flags and the DPT Type\n* Location information of devices (in which rooms they are)\n* Functions assigned to rooms\n\nCaution: Loading a middle-sized project with this tool takes about 1.5 seconds. For bigger projects this might as well be >3s.\n\nNot all supported languages are included in project / application data. If the configured language is not found, the default language will be used - which is manufacturer / product dependent.\n\n## Installation\n\n`pip install xknxproject`\n\n## Usage\n\n```python\n\"\"\"Extract and parse a KNX project file.\"\"\"\nfrom xknxproject.models import KNXProject\nfrom xknxproject import XKNXProj\n\n\nknxproj: XKNXProj = XKNXProj(\n    path=\"path/to/your/file.knxproj\",\n    password=\"password\",  # optional\n    language=\"de-DE\",  # optional\n)\nproject: KNXProject = knxproj.parse()\n```\n\nThe resulting `KNXProject` is a typed dictionary and can be used just like a dictionary, or can be exported as JSON.\nYou can find an example file (exported JSON) in our test suite under https://github.com/XKNX/xknxproject/tree/main/test/resources/stubs\n\nThe full type definition can be found here: https://github.com/XKNX/xknxproject/blob/main/xknxproject/models/knxproject.py\n",
    "bugtrack_url": null,
    "license": "GPL-2.0-only",
    "summary": "A library to gather information from ETS project files used for KNX",
    "version": "3.8.0",
    "project_urls": {
        "homepage": "https://github.com/XKNX/xknxproject"
    },
    "split_keywords": [
        "knx",
        " ets",
        " home assistant"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "11fa5be7862904218e1e0816a8e6b23ea6a0e388fe67e20948c172c5bf89a8a5",
                "md5": "6943e61dbfc45209c1eb8d24dc236251",
                "sha256": "f7071e39a44ef12e0ca2e13d66f0eab717cb5e2c9f99fe727d407ebaed8e8c7f"
            },
            "downloads": -1,
            "filename": "xknxproject-3.8.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6943e61dbfc45209c1eb8d24dc236251",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9.0",
            "size": 41263,
            "upload_time": "2024-09-30T06:57:18",
            "upload_time_iso_8601": "2024-09-30T06:57:18.764813Z",
            "url": "https://files.pythonhosted.org/packages/11/fa/5be7862904218e1e0816a8e6b23ea6a0e388fe67e20948c172c5bf89a8a5/xknxproject-3.8.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a0384f6e8e4942858c7586faf6c042fbf13e00b1f4e359bb9f24f7ef9e74008d",
                "md5": "e07f287c67c035eae371568917b235e9",
                "sha256": "7a1f76ee7d4d2320afa4596350260efdfcc681bba8d477d637c3ef9c38e1bf09"
            },
            "downloads": -1,
            "filename": "xknxproject-3.8.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e07f287c67c035eae371568917b235e9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9.0",
            "size": 38128,
            "upload_time": "2024-09-30T06:57:20",
            "upload_time_iso_8601": "2024-09-30T06:57:20.461547Z",
            "url": "https://files.pythonhosted.org/packages/a0/38/4f6e8e4942858c7586faf6c042fbf13e00b1f4e359bb9f24f7ef9e74008d/xknxproject-3.8.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-30 06:57:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "XKNX",
    "github_project": "xknxproject",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "xknxproject"
}
        
Elapsed time: 0.50694s