{"id":48278309,"url":"https://github.com/f0rw4rd/profinet-py","last_synced_at":"2026-04-04T22:41:00.583Z","repository":{"id":339064903,"uuid":"1160326603","full_name":"f0rw4rd/profinet-py","owner":"f0rw4rd","description":"PROFINET IO-Controller library for Python","archived":false,"fork":false,"pushed_at":"2026-04-02T16:50:46.000Z","size":310,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-02T17:43:57.453Z","etag":null,"topics":["automation","dcp","ics","industrial","ot","plc","profinet","python","rpc","siemens"],"latest_commit_sha":null,"homepage":"https://github.com/f0rw4rd/profinet-py","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f0rw4rd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"ko_fi":"f0rw4rd"}},"created_at":"2026-02-17T20:08:23.000Z","updated_at":"2026-04-02T16:50:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/f0rw4rd/profinet-py","commit_stats":null,"previous_names":["f0rw4rd/profinet-py"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/f0rw4rd/profinet-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0rw4rd%2Fprofinet-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0rw4rd%2Fprofinet-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0rw4rd%2Fprofinet-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0rw4rd%2Fprofinet-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f0rw4rd","download_url":"https://codeload.github.com/f0rw4rd/profinet-py/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0rw4rd%2Fprofinet-py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31417623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","dcp","ics","industrial","ot","plc","profinet","python","rpc","siemens"],"created_at":"2026-04-04T22:40:58.549Z","updated_at":"2026-04-04T22:41:00.574Z","avatar_url":"https://github.com/f0rw4rd.png","language":"Python","funding_links":["https://ko-fi.com/f0rw4rd"],"categories":[],"sub_categories":[],"readme":"# profinet-py\n\n[![CI](https://github.com/f0rw4rd/profinet-py/actions/workflows/ci.yml/badge.svg)](https://github.com/f0rw4rd/profinet-py/actions/workflows/ci.yml)\n[![PyPI](https://img.shields.io/pypi/v/profinet-py)](https://pypi.org/project/profinet-py/)\n[![Python](https://img.shields.io/pypi/pyversions/profinet-py)](https://pypi.org/project/profinet-py/)\n[![License](https://img.shields.io/github/license/f0rw4rd/profinet-py)](LICENSE)\n[![Code style: ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![CLA](https://img.shields.io/badge/CLA-required-blue)](CONTRIBUTING.md)\n\nA Python library for PROFINET IO communication, acting as an IO-Controller.\n\n## Features\n\n- **DCP Discovery \u0026 Configuration**: Find devices, set IP/name, signal LEDs, factory reset with full SET response validation\n- **DCE/RPC Communication**: Establish Application Relationships (AR) and perform acyclic read/write via slot/subslot/index\n- **I\u0026M Records**: Read/write Identification \u0026 Maintenance data (IM0-IM5)\n- **Cyclic I/O**: Real-time periodic data exchange (RT_CLASS_1) with state machine, double-buffered IO, cycle counter tracking, watchdog fault detection, and graceful shutdown\n- **Alarm Handling**: Background alarm listener per IEC 61158-6-10\n- **Diagnosis Parsing**: Channel, extended channel, and qualified channel diagnosis decoding\n- **Vendor Registry**: 2100+ PROFINET vendor IDs with name lookup\n- **Declarative Parsing**: Binary protocol parsing via [construct](https://construct.readthedocs.io/) library\n- **Cross-Platform**: Linux (AF_PACKET), Windows (Npcap)\n- **High-level API**: `ProfinetDevice` class and `scan()` for quick device interaction\n\n## Requirements\n\n- Python 3.10+\n- Administrator/root privileges (for raw Ethernet access)\n- `construct\u003e=2.10`\n\n### Platform-specific\n\n| Platform | Raw Socket Backend | Extra Software |\n|----------|-------------------|----------------|\n| **Linux** | AF_PACKET (built-in) | None |\n| **Windows** | Npcap (wpcap.dll) | Install [Npcap](https://npcap.com/) with \"WinPcap API-compatible Mode\" enabled |\n\n## Installation\n\n```bash\npip install profinet-py\n```\n\nFrom source:\n\n```bash\ngit clone https://github.com/f0rw4rd/profinet-py.git\ncd profinet-py\npip install -e \".[dev]\"\n```\n\n## Usage\n\n```python\nimport profinet\n\n# Discover all PROFINET devices on the network\nfor device in profinet.scan(\"eth0\", timeout=5):\n    print(f\"Found: {device.name} at {device.ip} ({device.mac})\")\n```\n\nOn Windows, use the adapter's friendly name:\n\n```python\nfor device in profinet.scan(\"Ethernet 3\", timeout=5):\n    print(f\"Found: {device.name} at {device.ip}\")\n```\n\n### Low-level DCP + RPC\n\n```python\nfrom profinet.util import ethernet_socket, get_mac\nfrom profinet.dcp import send_discover, read_response\nfrom profinet.rpc import RPCCon\n\n# Create raw socket on interface\nsock = ethernet_socket(\"eth0\")\nsrc_mac = get_mac(\"eth0\")\n\n# Discover PROFINET devices\nsend_discover(sock, src_mac)\nresponses = read_response(sock, src_mac, timeout_sec=5)\n\nsock.close()\n```\n\n### CLI\n\n```bash\n# Discover devices\nprofinet -i eth0 discover\n\n# Read I\u0026M0 from device\nprofinet -i eth0 read-inm0 device-name\n\n# Read raw record\nprofinet -i eth0 read device-name --slot 0 --subslot 1 --index 0xAFF0\n\n# Cyclic IO monitoring (default 32ms cycle)\nprofinet -i eth0 cyclic device-name --gsdml device.xml\n\n# Custom cycle time\nprofinet -i eth0 cyclic device-name --gsdml device.xml --cycle-ms 16\n```\n\n## Support\n\nIf you find this project useful, consider supporting development:\n\n[![Ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/f0rw4rd)\n\n## License\n\nDual-licensed under [GPL-3.0](LICENSE) and a [commercial license](LICENSE-COMMERCIAL.md).\n\nFree for open source use under GPL-3.0. If you want to use profinet-py in proprietary\nproducts without GPL obligations, a commercial license is available —\nsee [LICENSE-COMMERCIAL.md](LICENSE-COMMERCIAL.md) for details.\n\n## References\n\n- [PROFINET Specification](https://www.profibus.com/technology/profinet)\n- [Wireshark PROFINET/IO](https://wiki.wireshark.org/PROFINET/IO)\n- [construct library](https://construct.readthedocs.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff0rw4rd%2Fprofinet-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff0rw4rd%2Fprofinet-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff0rw4rd%2Fprofinet-py/lists"}