iot-protocols


Nameiot-protocols JSON
Version 2.1.0.2 PyPI version JSON
download
home_pageNone
SummaryGeneric IIoT protocols package
upload_time2024-05-21 06:49:52
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseNone
keywords python iiot protocols
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ---
author: Delhaye Adrien
year: 2023
---

# Iot Protocols

This git contains easy to use module for communication using various IIoT protocols.
Each subdirectory is a package that can be used independently and downloaded from PyPi.

## Install

```bash
pip install <name-of-package>
```

## Upload on Twine

### Upload pyporject.toml

> **More detailled informations on** <https://packaging.python.org/en/latest/tutorials/packaging-projects/>

Open the pyproject.toml file and update at least the _version_ field with your current verion following the template :

```bash
For alpha release : <version>.<subversion>.<feature>.<fix>-a<i>
For beta release : <version>.<subversion>.<feature>.<fix>-b<i>
For relase candidate release : <version>.<subversion>.<feature>.<fix>-rc<i>
For final release : <version>.<subversion>.<feature>.<fix>
```

With the following :

- \<version\> defines the core version of the application. This number increase when drastic changes havec been made.
- \<subversion> defines important changes like addition of modules or large modification but that doesn't change the global structure of the package.
- \<feature> defines an addition of any feature.
- \<fix> increase when a fix has been made.

### Save your changes

Save everything.

Test everyting.

Push the files on the gitlab repository with version associated TAG.

### Build the package

Ensure you have upgraded pip:

```bash
py -m pip install --upgrade pip
```

Then from the root directory of your module, where the **pyproject.toml** file belongs, execute :

```bash
py -m build
```

This will generate your package tar.gz and wheel files into the **build** folder.

### Upload the dist

First ensure you have twine updated:

```bash
py -m pip install --upgrade twine
```

Get your username and token from PyPi

Use the following command to upload and gives your username and token to authentify, with username as '\_\_token\_\_':

```bashpy -m twine upload dist/<package-file-to-update>
```

You can also, if the build package doesn't exists yet on the PyPi registry use :

```bash
py -m twine upload dist/*
```

## How to use

### Installation

```shell
pip install iot-protocols
```

### Modbus Client

```python
from iot_protocols.modbus import ModbusClient
from iot_protocols.modbus import requests

client = ModbusClient.with_serial_client(port: "/dev/ttyO3", method: "rtu", baudrate: 9600, parity: "N", stopbits: 1, bytesize: 8, timeout: int = 5)

request = requests.ReadHoldingRegister(address=30000, unit=1, count=6, encoding="str")
result = client.request(request)
```

### IEC62056 Client

```python
from iot_protocols.iec62056 import SerialClient

client = SerialClient(
    baudrate=19200,
    port="COM3",
    transport="serial",
    parity="E",
    bytesize=7,
    stopbits=1
)
result = client.request(device_addres="xxxxx", table=0 timeout=15)
# If you just want to read the client's identification message :
identification = client.read_tariff_identification(device_addres="xxxxx", ack_stop=True)
```

### Snap-7 Client

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "iot-protocols",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "python, iiot, protocols",
    "author": null,
    "author_email": "Adrien Delhaye <adrien.delhaye@memoco.eu>",
    "download_url": "https://files.pythonhosted.org/packages/98/2e/d68bdaa7de21f3bf2df147ddb0533e2391c036b93219208c5fab284218cb/iot_protocols-2.1.0.2.tar.gz",
    "platform": null,
    "description": "---\r\nauthor: Delhaye Adrien\r\nyear: 2023\r\n---\r\n\r\n# Iot Protocols\r\n\r\nThis git contains easy to use module for communication using various IIoT protocols.\r\nEach subdirectory is a package that can be used independently and downloaded from PyPi.\r\n\r\n## Install\r\n\r\n```bash\r\npip install <name-of-package>\r\n```\r\n\r\n## Upload on Twine\r\n\r\n### Upload pyporject.toml\r\n\r\n> **More detailled informations on** <https://packaging.python.org/en/latest/tutorials/packaging-projects/>\r\n\r\nOpen the pyproject.toml file and update at least the _version_ field with your current verion following the template :\r\n\r\n```bash\r\nFor alpha release : <version>.<subversion>.<feature>.<fix>-a<i>\r\nFor beta release : <version>.<subversion>.<feature>.<fix>-b<i>\r\nFor relase candidate release : <version>.<subversion>.<feature>.<fix>-rc<i>\r\nFor final release : <version>.<subversion>.<feature>.<fix>\r\n```\r\n\r\nWith the following :\r\n\r\n- \\<version\\> defines the core version of the application. This number increase when drastic changes havec been made.\r\n- \\<subversion> defines important changes like addition of modules or large modification but that doesn't change the global structure of the package.\r\n- \\<feature> defines an addition of any feature.\r\n- \\<fix> increase when a fix has been made.\r\n\r\n### Save your changes\r\n\r\nSave everything.\r\n\r\nTest everyting.\r\n\r\nPush the files on the gitlab repository with version associated TAG.\r\n\r\n### Build the package\r\n\r\nEnsure you have upgraded pip:\r\n\r\n```bash\r\npy -m pip install --upgrade pip\r\n```\r\n\r\nThen from the root directory of your module, where the **pyproject.toml** file belongs, execute :\r\n\r\n```bash\r\npy -m build\r\n```\r\n\r\nThis will generate your package tar.gz and wheel files into the **build** folder.\r\n\r\n### Upload the dist\r\n\r\nFirst ensure you have twine updated:\r\n\r\n```bash\r\npy -m pip install --upgrade twine\r\n```\r\n\r\nGet your username and token from PyPi\r\n\r\nUse the following command to upload and gives your username and token to authentify, with username as '\\_\\_token\\_\\_':\r\n\r\n```bashpy -m twine upload dist/<package-file-to-update>\r\n```\r\n\r\nYou can also, if the build package doesn't exists yet on the PyPi registry use :\r\n\r\n```bash\r\npy -m twine upload dist/*\r\n```\r\n\r\n## How to use\r\n\r\n### Installation\r\n\r\n```shell\r\npip install iot-protocols\r\n```\r\n\r\n### Modbus Client\r\n\r\n```python\r\nfrom iot_protocols.modbus import ModbusClient\r\nfrom iot_protocols.modbus import requests\r\n\r\nclient = ModbusClient.with_serial_client(port: \"/dev/ttyO3\", method: \"rtu\", baudrate: 9600, parity: \"N\", stopbits: 1, bytesize: 8, timeout: int = 5)\r\n\r\nrequest = requests.ReadHoldingRegister(address=30000, unit=1, count=6, encoding=\"str\")\r\nresult = client.request(request)\r\n```\r\n\r\n### IEC62056 Client\r\n\r\n```python\r\nfrom iot_protocols.iec62056 import SerialClient\r\n\r\nclient = SerialClient(\r\n    baudrate=19200,\r\n    port=\"COM3\",\r\n    transport=\"serial\",\r\n    parity=\"E\",\r\n    bytesize=7,\r\n    stopbits=1\r\n)\r\nresult = client.request(device_addres=\"xxxxx\", table=0 timeout=15)\r\n# If you just want to read the client's identification message :\r\nidentification = client.read_tariff_identification(device_addres=\"xxxxx\", ack_stop=True)\r\n```\r\n\r\n### Snap-7 Client\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Generic IIoT protocols package",
    "version": "2.1.0.2",
    "project_urls": {
        "Homepage": "https://pypi.org/manage/project/iot-protocols"
    },
    "split_keywords": [
        "python",
        " iiot",
        " protocols"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5232efaab96364f05f12523fd5de29528ef46591c09396c5ea13f9277a257294",
                "md5": "423d6ec7bcb061c801ebf6feedc181ff",
                "sha256": "1163c1119dc94512f1481bbf0f0df26e3fb644a127fac5f6b2e5bc47939c3cf8"
            },
            "downloads": -1,
            "filename": "iot_protocols-2.1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "423d6ec7bcb061c801ebf6feedc181ff",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 33573,
            "upload_time": "2024-05-21T06:49:51",
            "upload_time_iso_8601": "2024-05-21T06:49:51.064862Z",
            "url": "https://files.pythonhosted.org/packages/52/32/efaab96364f05f12523fd5de29528ef46591c09396c5ea13f9277a257294/iot_protocols-2.1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "982ed68bdaa7de21f3bf2df147ddb0533e2391c036b93219208c5fab284218cb",
                "md5": "05cbd5f5ea6f673e44973dbb65075b00",
                "sha256": "92e194c1385d4fa698dbf0e4862eb093780305c80447457c1d5f98a55b71dc06"
            },
            "downloads": -1,
            "filename": "iot_protocols-2.1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "05cbd5f5ea6f673e44973dbb65075b00",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 26962,
            "upload_time": "2024-05-21T06:49:52",
            "upload_time_iso_8601": "2024-05-21T06:49:52.461161Z",
            "url": "https://files.pythonhosted.org/packages/98/2e/d68bdaa7de21f3bf2df147ddb0533e2391c036b93219208c5fab284218cb/iot_protocols-2.1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-21 06:49:52",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "iot-protocols"
}
        
Elapsed time: 4.46053s