{"id":37063403,"url":"https://github.com/semiversus/python-durand","last_synced_at":"2026-01-14T07:13:37.950Z","repository":{"id":48239332,"uuid":"379399998","full_name":"semiversus/python-durand","owner":"semiversus","description":"Python CANopen library with focus on implementing server nodes","archived":false,"fork":false,"pushed_at":"2025-05-12T11:49:45.000Z","size":192,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-14T15:19:30.473Z","etag":null,"topics":["can","canopen","communication","embedded","python"],"latest_commit_sha":null,"homepage":"https://github.com/semiversus/python-durand","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/semiversus.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-06-22T21:02:49.000Z","updated_at":"2025-09-23T14:29:18.000Z","dependencies_parsed_at":"2024-09-12T14:29:22.333Z","dependency_job_id":"a5a040fe-3e23-4f16-b8a3-c5f2d79575f8","html_url":"https://github.com/semiversus/python-durand","commit_stats":{"total_commits":134,"total_committers":2,"mean_commits":67.0,"dds":0.02238805970149249,"last_synced_commit":"a61d50019f0af8e2b7df6a6fb62f74ecac0244e1"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/semiversus/python-durand","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semiversus%2Fpython-durand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semiversus%2Fpython-durand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semiversus%2Fpython-durand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semiversus%2Fpython-durand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/semiversus","download_url":"https://codeload.github.com/semiversus/python-durand/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semiversus%2Fpython-durand/sbom","scorecard":{"id":810839,"data":{"date":"2025-08-11","repo":{"name":"github.com/semiversus/python-durand","commit":"6a811c1bd250ce8c2ae69b00a5a24d46a70be443"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 2/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/workflow.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/workflow.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/semiversus/python-durand/workflow.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/workflow.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/semiversus/python-durand/workflow.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/workflow.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/semiversus/python-durand/workflow.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/workflow.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/semiversus/python-durand/workflow.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/workflow.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/semiversus/python-durand/workflow.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:17","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:22","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:50","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:51","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/workflow.yml:5"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T13:08:28.836Z","repository_id":48239332,"created_at":"2025-08-23T13:08:28.836Z","updated_at":"2025-08-23T13:08:28.836Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["can","canopen","communication","embedded","python"],"created_at":"2026-01-14T07:13:37.101Z","updated_at":"2026-01-14T07:13:37.933Z","avatar_url":"https://github.com/semiversus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"================================================\nPython Durand - CANopen Responder Device Library\n================================================\n\nA CANopen library to implement responder nodes.\n\n**Backends:**\n\n- CAN interfaces via python-can_\n\n.. header\n\nSynopsis\n========\n\n- Pure Python implementation\n- Licensed under MIT (2021 Günther Jena)\n- Source code hosted on GitHub.com_\n- Tested on Python 3.7, 3.8, 3.9, and 3.10\n- Unit tested with pytest_, coding style enforced with Black_, static type checking with mypy_, static code analysis with Pylint_, documentation generated with Sphinx_\n- Supports CiA301_ (EN 50325-4)\n\n.. _pytest: https://docs.pytest.org/en/latest\n.. _Black: https://black.readthedocs.io/en/stable/\n.. _mypy: http://mypy-lang.org/\n.. _Pylint: https://www.pylint.org/\n.. _Sphinx: http://www.sphinx-doc.org\n.. _GitHub.com: https://github.com/semiversus/python-durand\n.. _CiA301: http://can-cia.org/standardization/technical-documents\n\nFeature List\n============\n\n* **Object Dictionary:**\n\n  - Provides callbacks for validation, update, download, and read operations\n  - Supports records, arrays, and variables\n\n* **EDS Support:**\n\n  - Dynamic generation of EDS files\n  - Automatically provided via object 0x1021 (\"Store EDS\")\n\n* **SDO Servers:**\n\n  - Supports up to 128 SDO servers\n  - Expedited, segmented, and block transfer for upload and download\n  - Dynamically configurable COB-IDs\n  - Custom upload and download handlers supported\n\n* **PDO Support:**\n\n  - Up to 512 TPDOs and 512 RPDOs\n  - Dynamically configurable\n  - Transmission types: synchronous (acyclic and every nth sync) and event-driven\n  - Supports inhibit time\n\n* **EMCY Producer Service:**\n\n  - Dynamically configurable COB-ID\n  - Supports inhibit time\n\n* **Heartbeat Producer Service:**\n\n  - Dynamically configurable\n\n* **NMT Slave Service:**\n\n  - Boot-up service\n  - Callback for state change provided\n\n* **SYNC Consumer Service:**\n\n  - Dynamically configurable COB-ID\n  - Callback for received sync provided\n\n* **CiA305 Layer Setting Service:**\n\n  - Supports fast scan\n  - Configurable bitrate and node ID\n  - Identify remote responder supported\n\n* **CAN Interface Abstraction:**\n\n  - Full support for python-can_\n  - Automatic CAN ID filtering by subscribed services\n\n* **Scheduling:**\n\n  - Supports threaded and async operation\n\n**TODO:**\n\n- Build object dictionary via reading an EDS file\n- Support MPDOs\n- TIME consumer service\n- Up- and download handler as I/O streams\n\nExamples\n========\n\n**Creating a Node:**\n\n.. code-block:: python\n\n    import can\n    from durand import CANBusNetwork, Node, Variable, Record, DatatypeEnum\n\n    bus = can.Bus(bustype='socketcan', channel='vcan0')\n    network = CANBusNetwork(bus)\n    node = Node(network, node_id=0x01)\n\nCongratulations! You now have a CiA-301 compliant node running. The Layer Setting Service is also supported out of the box.\n\n**Adding Objects:**\n\n.. code-block:: python\n\n    od = node.object_dictionary\n\n    # Add variable at index 0x2000\n    od[0x2000] = Variable(DatatypeEnum.UNSIGNED16, access='rw', value=10, name='Parameter 1')\n\n    # Add record at index 0x2001\n    record = Record(name='Parameter Record')\n    record[1] = Variable(DatatypeEnum.UNSIGNED8, access='ro', value=0, name='Parameter 2a')\n    record[2] = Variable(DatatypeEnum.REAL32, access='rw', value=0, name='Parameter 2b')\n    od[0x2001] = record\n\n**Accessing Values:**\n\nThe objects can be read and written directly by accessing the object dictionary:\n\n.. code-block:: python\n\n    print(f'Value of Parameter 1: {od.read(0x2000, 0)}')\n    od.write(0x2001, 1, value=0xAA)\n\n**Adding Callbacks:**\n\nA more event-driven approach is to use callbacks. The following callbacks are available:\n\n- `validate_callbacks`: Called before a value in the object dictionary is updated\n- `update_callbacks`: Called when the value has been changed (via `od.write` or via CAN bus)\n- `download_callbacks`: Called when the value has been changed via CAN bus\n- `read_callback`: Called when an object is read (return value is used)\n\n.. code-block:: python\n\n    od.validate_callbacks[(0x2000, 0)].add(lambda v: v % 2 == 0)\n    od.update_callbacks[(0x2001, 2)].add(lambda v: print(f'Update for Parameter 2b: {v}'))\n    od.download_callbacks[(0x2000, 0)].add(lambda v: print(f'Download for Parameter 1: {v}'))\n    od.set_read_callback(0x2001, 1, lambda: 17)\n\n**PDO Mapping:**\n\nPDOs can be dynamically mapped via the SDO server or programmatically. The PDO indices start at 0.\n\n.. code-block:: python\n\n    node.tpdo[0].mapping = [(0x2001, 1), (0x2001, 2)]\n    node.tpdo[0].transmission_type = 1  # Transmit on every SYNC\n\n    node.rpdo[0].mapping = [(0x2000, 0)]\n    node.tpdo[0].transmission_type = 255  # Event-driven (processed when received)\n\nInstallation\n============\n\n.. code-block:: bash\n\n    pip install durand\n\nCredits\n=======\n\nThis library would not be possible without:\n\n- python-canopen_: CANopen library (by Christian Sandberg)\n- python-can_: CAN interface library (by Brian Thorne)\n\n.. _python-canopen: https://github.com/christiansandberg/canopen\n.. _python-can: https://github.com/hardbyte/python-can\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemiversus%2Fpython-durand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsemiversus%2Fpython-durand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemiversus%2Fpython-durand/lists"}