{"id":13442589,"url":"https://github.com/cantools/cantools","last_synced_at":"2026-04-01T20:44:25.626Z","repository":{"id":31045442,"uuid":"34604098","full_name":"cantools/cantools","owner":"cantools","description":"CAN bus tools.","archived":false,"fork":false,"pushed_at":"2026-03-23T18:22:44.000Z","size":4139,"stargazers_count":2212,"open_issues_count":125,"forks_count":630,"subscribers_count":69,"default_branch":"master","last_synced_at":"2026-03-24T16:35:50.878Z","etag":null,"topics":["arxml","can-bus","cdd","dbc","kcd","python","sym"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cantools.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"eerimoq"}},"created_at":"2015-04-26T08:37:47.000Z","updated_at":"2026-03-23T18:21:17.000Z","dependencies_parsed_at":"2023-02-16T12:25:16.453Z","dependency_job_id":"783646cd-fb5a-4327-abfc-12a3027164b1","html_url":"https://github.com/cantools/cantools","commit_stats":{"total_commits":1393,"total_committers":66,"mean_commits":"21.106060606060606","dds":0.4903086862885858,"last_synced_commit":"04ad96f6125b7fcf6f201549e71d18b22e382648"},"previous_names":["eerimoq/cantools"],"tags_count":249,"template":false,"template_full_name":null,"purl":"pkg:github/cantools/cantools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cantools%2Fcantools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cantools%2Fcantools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cantools%2Fcantools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cantools%2Fcantools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cantools","download_url":"https://codeload.github.com/cantools/cantools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cantools%2Fcantools/sbom","scorecard":{"id":264750,"data":{"date":"2025-08-11","repo":{"name":"github.com/cantools/cantools","commit":"d892c064c43bc00f87e51c9b44d946716851abaf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.6,"checks":[{"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":10,"reason":"all changesets reviewed","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":"Maintained","score":10,"reason":"30 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/pythonpackage.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":"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":"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/pythonpackage.yml:113: update your workflow using https://app.stepsecurity.io/secureworkflow/cantools/cantools/pythonpackage.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pythonpackage.yml:115: update your workflow using https://app.stepsecurity.io/secureworkflow/cantools/cantools/pythonpackage.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pythonpackage.yml:134: update your workflow using https://app.stepsecurity.io/secureworkflow/cantools/cantools/pythonpackage.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pythonpackage.yml:138: update your workflow using https://app.stepsecurity.io/secureworkflow/cantools/cantools/pythonpackage.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pythonpackage.yml:149: update your workflow using https://app.stepsecurity.io/secureworkflow/cantools/cantools/pythonpackage.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pythonpackage.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/cantools/cantools/pythonpackage.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pythonpackage.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/cantools/cantools/pythonpackage.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pythonpackage.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/cantools/cantools/pythonpackage.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pythonpackage.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/cantools/cantools/pythonpackage.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pythonpackage.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/cantools/cantools/pythonpackage.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pythonpackage.yml:65: update your workflow using https://app.stepsecurity.io/secureworkflow/cantools/cantools/pythonpackage.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pythonpackage.yml:72: update your workflow using https://app.stepsecurity.io/secureworkflow/cantools/cantools/pythonpackage.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pythonpackage.yml:74: update your workflow using https://app.stepsecurity.io/secureworkflow/cantools/cantools/pythonpackage.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pythonpackage.yml:96: update your workflow using https://app.stepsecurity.io/secureworkflow/cantools/cantools/pythonpackage.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pythonpackage.yml:98: update your workflow using https://app.stepsecurity.io/secureworkflow/cantools/cantools/pythonpackage.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yml:120","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yml:121","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yml:143","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yml:144","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yml:48","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yml:49","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yml:79","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yml:80","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yml:81","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yml:103","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yml:104","Warn: pipCommand not pinned by hash: .github/workflows/pythonpackage.yml:105","Info:   0 out of  12 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned","Info:   0 out of  14 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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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: 'allow deletion' enabled on branch 'master'","Warn: 'force pushes' enabled on branch 'master'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'master'","Warn: could not determine whether codeowners review is allowed","Warn: no status checks found to merge onto branch 'master'","Warn: PRs are not required to make changes on branch 'master'; or we don't have data to detect it.If you think it might be the latter, make sure to run Scorecard with a PAT or use Repo Rules (that are always public) instead of Branch Protection settings"],"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":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/pythonpackage.yml:127"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 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-17T11:41:46.005Z","repository_id":31045442,"created_at":"2025-08-17T11:41:46.005Z","updated_at":"2025-08-17T11:41:46.005Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"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":["arxml","can-bus","cdd","dbc","kcd","python","sym"],"created_at":"2024-07-31T03:01:47.665Z","updated_at":"2026-04-01T20:44:25.573Z","avatar_url":"https://github.com/cantools.png","language":"Python","readme":"|github-actions| |coverage|\n\nAbout\n=====\n\nCAN BUS tools in Python 3.\n\n- `DBC`_, `KCD`_, SYM, ARXML 3\u00264 and CDD file parsing.\n\n- CAN message encoding and decoding.\n\n- Simple and extended signal multiplexing.\n\n- Diagnostic DID encoding and decoding.\n\n- ``candump`` output decoder.\n\n- Node `tester`_.\n\n- `C` source code generator.\n\n- CAN bus monitor.\n\n- Graphical plots of signals.\n\nProject homepage: https://github.com/cantools/cantools\n\nDocumentation: https://cantools.readthedocs.io\n\nInstallation\n============\n\n.. code-block:: bash\n\n    python3 -m pip install cantools\n\nExample usage\n=============\n\nScripting\n---------\n\nThe example starts by parsing a `small DBC-file`_ and printing its\nmessages and signals.\n\n.. code-block:: python\n\n   \u003e\u003e\u003e import cantools\n   \u003e\u003e\u003e from pprint import pprint\n   \u003e\u003e\u003e db = cantools.database.load_file('tests/files/dbc/motohawk.dbc')\n   \u003e\u003e\u003e db.messages\n   [message('ExampleMessage', 0x1f0, False, 8, 'Example message used as template in MotoHawk models.')]\n   \u003e\u003e\u003e example_message = db.get_message_by_name('ExampleMessage')\n   \u003e\u003e\u003e pprint(example_message.signals)\n   [signal('Enable', 7, 1, 'big_endian', False, 1.0, 0, 0.0, 0.0, '-', False, None, {0: 'Disabled', 1: 'Enabled'}, None),\n    signal('AverageRadius', 6, 6, 'big_endian', False, 0.1, 0, 0.0, 5.0, 'm', False, None, None, ''),\n    signal('Temperature', 0, 12, 'big_endian', True, 0.01, 250, 229.53, 270.47, 'degK', False, None, None, None)]\n\nThe example continues `encoding`_ a message and sending it on a CAN\nbus using the `python-can`_ package.\n\n.. code-block:: python\n\n   \u003e\u003e\u003e import can\n   \u003e\u003e\u003e can_bus = can.interface.Bus('vcan0', bustype='socketcan')\n   \u003e\u003e\u003e data = example_message.encode({'Temperature': 250.1, 'AverageRadius': 3.2, 'Enable': 1})\n   \u003e\u003e\u003e message = can.Message(arbitration_id=example_message.frame_id, is_extended_id=example_message.is_extended_frame, data=data)\n   \u003e\u003e\u003e can_bus.send(message)\n\nAlternatively, a message can be encoded using the `encode_message()`_\nmethod on the database object.\n\nThe last part of the example receives and `decodes`_ a CAN message.\n\n.. code-block:: python\n\n   \u003e\u003e\u003e message = can_bus.recv()\n   \u003e\u003e\u003e db.decode_message(message.arbitration_id, message.data)\n   {'AverageRadius': 3.2, 'Enable': 'Enabled', 'Temperature': 250.09}\n\nSee `examples`_ for additional examples.\n\nCommand line tool\n-----------------\n\nThe decode subcommand\n^^^^^^^^^^^^^^^^^^^^^\n\nDecode CAN frames captured with the Linux program ``candump``.\n\n.. code-block:: text\n\n   $ candump vcan0 | python3 -m cantools decode tests/files/dbc/motohawk.dbc\n     vcan0  1F0   [8]  80 4A 0F 00 00 00 00 00 ::\n   ExampleMessage(\n       Enable: 'Enabled' -,\n       AverageRadius: 0.0 m,\n       Temperature: 255.92 degK\n   )\n     vcan0  1F0   [8]  80 4A 0F 00 00 00 00 00 ::\n   ExampleMessage(\n       Enable: 'Enabled' -,\n       AverageRadius: 0.0 m,\n       Temperature: 255.92 degK\n   )\n     vcan0  1F0   [8]  80 4A 0F 00 00 00 00 00 ::\n   ExampleMessage(\n       Enable: 'Enabled' -,\n       AverageRadius: 0.0 m,\n       Temperature: 255.92 degK\n   )\n\nAlternatively, the decoded message can be printed on a single line:\n\n.. code-block:: text\n\n   $ candump vcan0 | python3 -m cantools decode --single-line tests/files/dbc/motohawk.dbc\n     vcan0  1F0   [8]  80 4A 0F 00 00 00 00 00 :: ExampleMessage(Enable: 'Enabled' -, AverageRadius: 0.0 m, Temperature: 255.92 degK)\n     vcan0  1F0   [8]  80 4A 0F 00 00 00 00 00 :: ExampleMessage(Enable: 'Enabled' -, AverageRadius: 0.0 m, Temperature: 255.92 degK)\n     vcan0  1F0   [8]  80 4A 0F 00 00 00 00 00 :: ExampleMessage(Enable: 'Enabled' -, AverageRadius: 0.0 m, Temperature: 255.92 degK)\n\nThe plot subcommand\n^^^^^^^^^^^^^^^^^^^\n\nThe plot subcommand is similar to the decode subcommand but messages are visualized using `matplotlib`_ instead of being printed to stdout.\n\n.. code-block:: bash\n\n    $ candump -l vcan0\n    $ cat candump-2021-01-04_180521.log\n    (1609779922.655421) vcan0 00000343#B204B9049C049C04\n    (1609779922.655735) vcan0 0000024A#120527052E051905\n    (1609779923.657524) vcan0 00000343#C404C404CB04C404\n    (1609779923.658086) vcan0 0000024A#8B058B058B059205\n    (1609779924.659912) vcan0 00000343#5C04790479045504\n    (1609779924.660471) vcan0 0000024A#44064B0659064406\n    (1609779925.662277) vcan0 00000343#15040704F203F203\n    (1609779925.662837) vcan0 0000024A#8B069906A706A706\n    (1609779926.664191) vcan0 00000343#BC03B503A703BC03\n    (1609779926.664751) vcan0 0000024A#A006A706C406C406\n\n    $ cat candump-2021-01-04_180521.log | python3 -m cantools plot tests/files/dbc/abs.dbc\n\n.. image:: https://github.com/cantools/cantools/raw/master/docs/plot-1.png\n\nIf you don't want to show all signals you can select the desired signals with command line arguments.\nA ``*`` can stand for any number of any character, a ``?`` for exactly one arbitrary character.\nSignals separated by a ``-`` are displayed in separate subplots.\nOptionally a format can be specified after a signal, separated by a colon.\n\n.. code-block:: bash\n\n    $ cat candump-2021-01-04_180521.log | python3 -m cantools plot tests/files/dbc/abs.dbc '*33.*fl:-\u003c' '*33.*fr:-\u003e' - '*33.*rl:-\u003c' '*33.*rr:-\u003e'\n\n.. image:: https://github.com/cantools/cantools/raw/master/docs/plot-2-subplots.png\n\nSignals with a different range of values can be displayed in the same subplot on different vertical axes by separating them with a comma.\n\n.. code-block:: bash\n\n   $ cat candump-2021-01-04_180521.log | cantools plot --auto-color tests/files/dbc/abs.dbc -- \\\n      --ylabel 'Bremse 33' '*_33.*fl*:-\u003c' '*_33.*fr*:\u003e' '*_33.*rl*:3' '*_33.*rr*:4' , \\\n      --ylabel 'Bremse 2' '*_2.*fl*:-\u003c' '*_2.*fr*:\u003e' '*_2.*rl*:3' '*_2.*rr*:4'\n\n.. image:: https://github.com/cantools/cantools/raw/master/docs/plot-2-axes.png\n\nMatplotlib comes with different preinstalled styles that you can use:\n\n.. code-block:: bash\n\n   $ cat candump-2021-01-04_180521.log | cantools plot tests/files/dbc/abs.dbc --style seaborn\n\n.. image:: https://github.com/cantools/cantools/raw/master/docs/plot-seaborn.png\n\nYou can try all available styles with\n\n.. code-block:: bash\n\n   $ cantools plot --list-styles . | sed -n '/^- /s/^- //p' | while IFS= read -r style; do\n         cat candump-2021-01-04_180521.log | cantools plot tests/files/dbc/abs.dbc --style \"$style\" --title \"--style '$style'\"\n     done\n\nFor more information see\n\n.. code-block:: bash\n\n    $ python3 -m cantools plot --help\n\nNote that by default matplotlib is not installed with cantools. But it can be by specifying an extra\nat installation:\n\n.. code-block:: bash\n\n    $ python3 -m pip install cantools[plot]\n\nThe dump subcommand\n^^^^^^^^^^^^^^^^^^^\n\nDump given database in a human readable format:\n\n.. code-block:: text\n\n   $ python3 -m cantools dump tests/files/dbc/motohawk.dbc\n   ================================= Messages =================================\n\n     ------------------------------------------------------------------------\n\n     Name:       ExampleMessage\n     Id:         0x1f0\n     Length:     8 bytes\n     Cycle time: - ms\n     Senders:    PCM1\n     Layout:\n\n                             Bit\n\n                7   6   5   4   3   2   1   0\n              +---+---+---+---+---+---+---+---+\n            0 |\u003c-x|\u003c---------------------x|\u003c--|\n              +---+---+---+---+---+---+---+---+\n                |                       +-- AverageRadius\n                +-- Enable\n              +---+---+---+---+---+---+---+---+\n            1 |-------------------------------|\n              +---+---+---+---+---+---+---+---+\n            2 |----------x|   |   |   |   |   |\n        B     +---+---+---+---+---+---+---+---+\n        y               +-- Temperature\n        t     +---+---+---+---+---+---+---+---+\n        e   3 |   |   |   |   |   |   |   |   |\n              +---+---+---+---+---+---+---+---+\n            4 |   |   |   |   |   |   |   |   |\n              +---+---+---+---+---+---+---+---+\n            5 |   |   |   |   |   |   |   |   |\n              +---+---+---+---+---+---+---+---+\n            6 |   |   |   |   |   |   |   |   |\n              +---+---+---+---+---+---+---+---+\n            7 |   |   |   |   |   |   |   |   |\n              +---+---+---+---+---+---+---+---+\n\n     Signal tree:\n\n       -- {root}\n          +-- Enable\n          +-- AverageRadius\n          +-- Temperature\n\n     Signal choices:\n\n       Enable\n           0 Disabled\n           1 Enabled\n\n     ------------------------------------------------------------------------\n\nThe list subcommand\n^^^^^^^^^^^^^^^^^^^\n\nPrint all information of a given database in a human readable\nformat. This is very similar to the \"dump\" subcommand, but the output\nis less pretty, slightly more comprehensive and easier to parse by\nshell scripts:\n\n.. code-block:: bash\n\n    $ python3 -m cantools list -a tests/files/dbc/motohawk.dbc\n    ExampleMessage:\n      Comment[None]: Example message used as template in MotoHawk models.\n      Frame ID: 0x1f0 (496)\n      Size: 8 bytes\n      Is extended frame: False\n      Signals:\n        Enable:\n          Type: Integer\n          Start bit: 7\n          Length: 1 bits\n          Unit: -\n          Is signed: False\n          Named values:\n            0: Disabled\n\nThe generate C source subcommand\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nGenerate `C` source code from given database.\n\nThe generated code contains:\n\n- Message `structs`_.\n\n- Message `pack`_ and `unpack`_ functions.\n\n- Signal `encode`_ and `decode`_ functions.\n\n- Frame id, length, type, cycle time and signal choices `defines`_.\n\nKnown limitations:\n\n- The maximum signal size is 64 bits, which in practice is never\n  exceeded.\n\nBelow is an example of how to generate C source code from a\ndatabase. The database is ``tests/files/dbc/motohawk.dbc``.\n\n.. code-block:: text\n\n   $ python3 -m cantools generate_c_source tests/files/dbc/motohawk.dbc\n   Successfully generated motohawk.h and motohawk.c.\n\nSee `motohawk.h`_ and `motohawk.c`_ for the contents of the generated\nfiles.\n\nIn this example we use ``--use-float`` so floating point numbers in the generated\ncode are single precision (``float``) instead of double precision (``double``).\n\n.. code-block:: text\n\n   $ python3 -m cantools generate_c_source --use-float tests/files/dbc/motohawk.dbc\n   Successfully generated motohawk.h and motohawk.c.\n\nIn the next example we use ``--database-name`` to set a custom\nnamespace for all generated types, defines and functions. The output\nfile names are also changed by this option.\n\n.. code-block:: text\n\n   $ python3 -m cantools generate_c_source --database-name my_database_name tests/files/dbc/motohawk.dbc\n   Successfully generated my_database_name.h and my_database_name.c.\n\nSee `my_database_name.h`_ and `my_database_name.c`_ for the contents\nof the generated files.\n\nIn the next example we use ``--no-floating-point-numbers`` to generate\ncode without floating point types, i.e. ``float`` and ``double``.\n\n.. code-block:: text\n\n   $ python3 -m cantools generate_c_source --no-floating-point-numbers tests/files/dbc/motohawk.dbc\n   Successfully generated motohawk.h and motohawk.c.\n\nSee `motohawk_no_floating_point_numbers.h`_ and\n`motohawk_no_floating_point_numbers.c`_ for the contents of the\ngenerated files.\n\nIn the last example ``--node`` is used to generate\nmessage pack functions only for messages sent by the specified node and unpack\nfunctions only for messages with its signal receivers belonging to that node. \n\n.. code-block:: text\n\n   $ cantools generate_c_source tests/files/dbc/motohawk.dbc --node PCM1\n   Successfully generated motohawk.h and motohawk.c.\n\nSee `motohawk_sender_node.h`_ and\n`motohawk_sender_node.c`_ for the contents of the\ngenerated files.\n\nOther C code generators:\n\n- http://www.coderdbc.com\n\n- https://github.com/howerj/dbcc\n\n- https://github.com/lonkamikaze/hsk-libs/blob/master/scripts/dbc2c.awk\n\n- https://sourceforge.net/projects/comframe/\n\nThe monitor subcommand\n^^^^^^^^^^^^^^^^^^^^^^\n\nMonitor CAN bus traffic in a text based user interface.\n\n.. code-block:: text\n\n   $ python3 -m cantools monitor tests/files/dbc/motohawk.dbc\n\n.. image:: https://github.com/cantools/cantools/raw/master/docs/monitor.png\n\nThe menu at the bottom of the monitor shows the available commands.\n\n- Quit: Quit the monitor. Ctrl-C can be used as well.\n\n- Filter: Only display messages or signals matching given regular\n  expression. Press \u003cEnter\u003e to return to the menu from the filter\n  input line.\n\n- Play/Pause: Toggle between playing and paused (or running and freezed).\n\n- Reset: Reset the monitor to its initial state.\n\nContributing\n============\n\n#. Fork the repository.\n\n#. Install prerequisites. You can skip this if you use `tox`_.\n\n   .. code-block:: text\n\n      python3 -m pip install -e .[dev]\n\n#. Implement the new feature or bug fix.\n\n#. Implement test case(s) to ensure that future changes do not break\n   legacy.\n\n#. Run the linters\n\n   .. code-block:: text\n\n      ruff check src\n      mypy src\n\n   or\n\n   .. code-block:: text\n\n      tox -e ruff\n      tox -e mypy\n\n#. Run the tests.\n\n   .. code-block:: text\n\n      tox -e py\n\n#. Check test coverage.\n\n   .. code-block:: text\n\n      tox -e cov\n      firefox htmlcov/index.html\n\n#. Create a pull request.\n\n.. |github-actions| image:: https://github.com/cantools/cantools/actions/workflows/pythonpackage.yml/badge.svg?branch=master\n   :target: https://github.com/cantools/cantools/actions/workflows/pythonpackage.yml\n   :alt: Github Actions workflow status\n\n.. |coverage| image:: https://coveralls.io/repos/github/cantools/cantools/badge.svg?branch=master\n   :target: https://coveralls.io/github/cantoolscantools?branch=master\n   :alt: Test coverage reports on Coveralls.io\n\n\n.. _small DBC-file: https://github.com/cantools/cantools/blob/master/tests/files/dbc/motohawk.dbc\n\n.. _motohawk.dbc: https://github.com/cantools/cantools/blob/master/tests/files/dbc/motohawk.dbc\n\n.. _python-can: https://python-can.readthedocs.io/en/master/\n\n.. _DBC: http://www.socialledge.com/sjsu/index.php?title=DBC_Format\n\n.. _KCD: https://github.com/julietkilo/kcd\n\n.. _tester: http://cantools.readthedocs.io/en/latest/#cantools.tester.Tester\n\n.. _encoding: http://cantools.readthedocs.io/en/latest/#cantools.database.can.Message.encode\n\n.. _encode_message(): http://cantools.readthedocs.io/en/latest/#cantools.database.can.Database.encode_message\n\n.. _decodes: http://cantools.readthedocs.io/en/latest/#cantools.database.can.Database.decode_message\n\n.. _examples: https://github.com/cantools/cantools/blob/master/examples\n\n.. _structs: https://github.com/cantools/cantools/blob/master/tests/files/c_source/motohawk.h#L58\n\n.. _pack: https://github.com/cantools/cantools/blob/master/tests/files/c_source/motohawk.h#L88\n\n.. _unpack: https://github.com/cantools/cantools/blob/master/tests/files/c_source/motohawk.h#L102\n\n.. _encode: https://github.com/cantools/cantools/blob/master/tests/files/c_source/motohawk.h#L116\n\n.. _decode: https://github.com/cantools/cantools/blob/master/tests/files/c_source/motohawk.h#L125\n\n.. _defines: https://github.com/cantools/cantools/blob/master/tests/files/c_source/motohawk.h#L42\n\n.. _motohawk.h: https://github.com/cantools/cantools/blob/master/tests/files/c_source/motohawk.h\n\n.. _motohawk.c: https://github.com/cantools/cantools/blob/master/tests/files/c_source/motohawk.c\n\n.. _my_database_name.h: https://github.com/cantools/cantools/blob/master/tests/files/c_source/my_database_name.h\n\n.. _my_database_name.c: https://github.com/cantools/cantools/blob/master/tests/files/c_source/my_database_name.c\n\n.. _motohawk_no_floating_point_numbers.h: https://github.com/cantools/cantools/blob/master/tests/files/c_source/motohawk_no_floating_point_numbers.h\n\n.. _motohawk_no_floating_point_numbers.c: https://github.com/cantools/cantools/blob/master/tests/files/c_source/motohawk_no_floating_point_numbers.c\n\n.. _motohawk_sender_node.h: https://github.com/cantools/cantools/blob/master/tests/files/c_source/motohawk_sender_node.h\n\n.. _motohawk_sender_node.c: https://github.com/cantools/cantools/blob/master/tests/files/c_source/motohawk_sender_node.c\n\n.. _matplotlib: https://matplotlib.org/\n\n.. _tox: http://tox.readthedocs.org/\n","funding_links":["https://github.com/sponsors/eerimoq"],"categories":["Python","CAN","Utils"],"sub_categories":["Tools","Python Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcantools%2Fcantools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcantools%2Fcantools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcantools%2Fcantools/lists"}