{"id":13740957,"url":"https://github.com/jmscslgroup/strym","last_synced_at":"2025-07-31T13:12:58.012Z","repository":{"id":44990492,"uuid":"221139800","full_name":"jmscslgroup/strym","owner":"jmscslgroup","description":"A real time CAN vehicle data logging, analysis and visualization tool to work with USB-CAN Interface for developing in-vehicle AI algorithms for self-driving and automation","archived":false,"fork":false,"pushed_at":"2025-06-09T21:14:07.000Z","size":187650,"stargazers_count":30,"open_issues_count":8,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-07T21:19:46.891Z","etag":null,"topics":["can-bus","cantools","commaai","data-visualization","openpilot","python3","visualization"],"latest_commit_sha":null,"homepage":"https://jmscslgroup.github.io/strym/","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/jmscslgroup.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"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}},"created_at":"2019-11-12T05:48:05.000Z","updated_at":"2025-06-23T07:51:40.000Z","dependencies_parsed_at":"2025-07-07T21:19:58.313Z","dependency_job_id":"37bff6ee-e203-4f34-9e0c-4bf8783878ac","html_url":"https://github.com/jmscslgroup/strym","commit_stats":{"total_commits":479,"total_committers":13,"mean_commits":36.84615384615385,"dds":"0.20041753653444672","last_synced_commit":"060f69927b57612292ac75ac44275166e0c59758"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jmscslgroup/strym","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmscslgroup%2Fstrym","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmscslgroup%2Fstrym/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmscslgroup%2Fstrym/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmscslgroup%2Fstrym/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmscslgroup","download_url":"https://codeload.github.com/jmscslgroup/strym/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmscslgroup%2Fstrym/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268045228,"owners_count":24186757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-bus","cantools","commaai","data-visualization","openpilot","python3","visualization"],"created_at":"2024-08-03T04:00:53.954Z","updated_at":"2025-07-31T13:12:57.963Z","avatar_url":"https://github.com/jmscslgroup.png","language":"Python","readme":"\u003cimg src=\"https://raw.githubusercontent.com/jmscslgroup/strym/master/strym.png\" alt=\"Strym Logo\" align=\"center\"/\u003e\n\n\n# Strym\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/jmscslgroup/strym/graphs/commit-activity)\n[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)\n[![made-with-sphinx-doc](https://img.shields.io/badge/Made%20with-Sphinx-1f425f.svg)](https://www.sphinx-doc.org/)\n[![PyPI version shields.io](https://img.shields.io/pypi/v/strym.svg)](https://pypi.python.org/pypi/strym/)\n[![Downloads](https://pepy.tech/badge/strym)](https://pepy.tech/project/strym)\n\n\n## Citation\nPlease cite our work as follows if you have used Strym:\n\n    Bhadani, Rahul, Matt Bunting, Matthew Nice, Ngoc Minh Tran, Safwan Elmadani, Dan Work, and Jonathan Sprinkle.\n    Strym: A python package for real-time can data logging, analysis and visualization to work with usb-can interface.\"\n    In 2022 2nd Workshop on Data-Driven and Intelligent Cyber-Physical Systems for Smart Cities Workshop (DI-CPS), pp. 14-23. IEEE, 2022.\n\n\n```\n@inproceedings{bhadani2022strym,\n  title={Strym: A python package for real-time can data logging, analysis and visualization to work with usb-can interface},\n  author={Bhadani, Rahul and Bunting, Matt and Nice, Matthew and Tran, Ngoc Minh and Elmadani, Safwan and Work, Dan and Sprinkle, Jonathan},\n  booktitle={2022 2nd Workshop on Data-Driven and Intelligent Cyber-Physical Systems for Smart Cities Workshop (DI-CPS)},\n  pages={14--23},\n  year={2022},\n  organization={IEEE}\n}\n```\n\n\n__A python package for real-time CAN data logging, analysis and visualization to work with USB-CAN Interface.__\n\n__Strym__ is a python package that provides APIs to interface with COMMA.AI panda for logging CAN data, analysis and visualization in real-time from supported modern vehicles such Toyota RAV4 and Honda Pilot. There are two kinds of functionality that __Strym__ provides: \n\n1. Real-time visualization of CAN data through comma.ai Panda and Giraffe connector.\n2. Offline analysis and visualization of CAN Data from a CSV Formatted file.\n\n## Installation\nThe recommended way to use strym is with UV package manager and virutal environment.\n\n### Installing Rust and Cargo\n```\ncurl https://sh.rustup.rs -sSf | sh\n\n```\n### Installing UV\n```\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n\n```\n\nClose the terminal and reopen it.\n\n\n### Creating Python Virtual Environment\n```\nmkdir -p playground/stream\ncd playground/stream\nuv python install 3.12\nuv init --name stream --no-package\nuv venv --python 3.12\n# activate virtual environment\nsource .venv/bin/activate\nuv add strym\nuv add ipykernel\nuv add notebook\n```\n\nThe above has to be done one time only.\n\nFor the subsequent session, do the following, after opening the new terminal\n\nIf you have an existing conda environment, deactivate using `conda deactivate`. \nIf you have any other python virtual environment, deactivate that as well.\n\n### Using strym\n\n```\ncd playground/stream\nsource .venv/bin/activate\njupyter notebook\n```\nIt will launch the jupyter notebook.\n \nCreate a new notebook, and add the following code:\n\n```\nimport strym\nfrom strym import strymread\n# change the file name as per your convenience\nfile = \"2021-06-04-12-01-39_2T3MWRFVXLW056972_CAN_Messages.csv\"\nr = strymread(file)\nr.speed()\n```\n\nIf you see the speed dataframe, it means strym is read to be used by you.\n\nYou should also be able to use Visual Studio code in the same manner by following the instruction\n\n```\ncd playground/stream\nsource .venv/bin/activate\ncode .\n```\nThen, you can create a Python notebook, and select the Python Kernel from `.venv/bin/activate`.\n\n## Philosophy behind Strym\n\nStrym data is capable of handling timeseries data obtained from Comma.ai Panda and Giraffe Connector. \nMost functions and methods in `strym` expects timeseries data of following format\n\n|   | Time               | Message |\n|---|--------------------|---------|\n| 1 | 1582056042.5040324 | 2.0     |\n| 2 | 1582056043.5040324 | 2.1     |\n| 3 | 1582056044.5040324 | 2.12    |\n| 4 | 1582056045.5040324 | 1.98    |\n| 5 | 1582056046.5040324 | 1.6     |\n\nHere, data should be of type Pandas.DataFrame with two columns: Time and Message. \n\nHowever, scope of strym is not limited to timeseries data obtained from comma.ai Panda. Any timeseries data of above format is capable of harnessing methods available in `strym`.\n\n## Quick Start for CAN Data Analysis and Visualization\n\nYou can use __Strym__ for quick visualization by importing `strymread`:\n```python\nimport strym\nfrom strym import strymread\nfrom strym import ranalyze\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom pylab import rcParams\nimport strym.DBC_Read_Tools as dbc\nimport numpy as np\nplt.rcParams[\"figure.figsize\"] = (16,8)\nrcParams.update({'font.size': 40})\ndbcfile = '/home/ivory/VersionControl/Jmscslgroup/strym/examples/newToyotacode.dbc'\nr =strymread(csvfile=\"/home/ivory/CyverseData/JmscslgroupData/PandaData/2020_02_18/2020-02-18-13-00-42-209119__CAN_Messages.csv\", dbcfile=dbcfile)\n```\n\nCheckout documentation at https://jmscslgroup.github.io/strym/getting_started.html for more in-depth tutorials.\n\n## Software Requirements\n- Ubuntu 20.04 or higher\n- Python 3.12\n- UV package manager\n\n### Note about installation on RASPBERRY PI for CAN Data Logging\nIf you are going to install the package on RASPBERRY PI, I highly recommend installing Python 3.7 from the source as there is no Py3.7 release for Raspberry PI.\nYou will also need to install pre-compiled binaries for NumPy otherwise you may encounter huge inconvenience while building NumPy wheels for Raspberry PI.\n\n\n## Hardware Requirements for CAN Logging\n- comma.ai CAN-USB __Panda__ board.\n- comma.ai Giraffee Connector\n- A modern vehicle with CAN Bus available such as Toyota RAV4, Toyota CHR, etc. \n\n## Installation Instructions\n\n[![Install Instruction](https://img.youtube.com/vi/w2p1uYmHBPA/0.jpg)](https://www.youtube.com/watch?v=w2p1uYmHBPA\u0026t=5s)\n\n\n\n## Usage for Real-Time Visualization of CAN messages using Strym\n\nPlug your Comma AI Panda device using Giraffe Connector to your CAR's OBD port for data logging and streaming. Insert one end of the USB to Panda Device and another end to your laptop.\n\nIn python, you will be required to create an object of type `Strym`:\n\n\nSee `strym_impl.py` for one such usage example in the [example folder](https://github.com/jmscslgroup/strym/blob/master/examples), however, I am provided details of an example below:\n\n\nCreate a new file. I will use the gedit to create a new file. You will be required to pass a path of the CAN Database DBC file to `strym` while instantiating its object. Once you have a `strym` object, you can call its `isoviz()` function. `isoviz()` function takes two arguments: i) the message type that you want to visualize, e.g. SPEED ii) attribute number to plot specific signal of the desired message type. `isoviz()` function will simultaneously capture CAN message in a CSV file and also plot the desired message's signal. To terminate, press CTRL-C. Upon pressing CTRL-C, a SIGINT signal handler will be called that will terminate the logging of CAN messages and also save a matplotlib figure of the desired message's signal in pdf and pickle format.\n\n```bash\ngedit viz_example.py\n```\n\n```python\nfrom strym import strym\nimport cantools\nimport sys, math, time\nimport signal\n\ndb = './newToyotacode.dbc'\n\nViz = strym(dbcfile = db)\n\nmessage_type_to_visualize = 'SPEED'\nmessage_attribute_number_to_visualize = 1\n\nvisualize = False\noptions = {\"log\": \"info\" }\nViz.isolog(visualize, message_type_to_visualize, message_attribute_number_to_visualize,  **options)\n\nsignal.signal(signal.SIGINT, Viz.kill)\n\nprint('Datafile saved is {}'.format(Viz.logfile))\n\n\n```\n\nYou will need a DBC file to parse can messages. Download an example DBC file [here](https://github.com/jmscslgroup/strym/blob/master/examples/newToyotacode.dbc)\n\nTo run the above program:\n\n```bash\npython viz_example.py`\n```\n\nIf you are done, press CTRL-C.\n\n## Issues\nIf you run into any issues, please use the issue feature of GitHub to log your issues. I will try my best to address any issue as soon as\npossible.\n\nFor an issue related to installation/use on windows, please see following filed issues:\n\n1. [Issue #8: OSError: [WinError 126]](https://github.com/jmscslgroup/strym/issues/8)\n\n## Contributing to this project\nIf you like to contribute to this project, please fork this repository to your GitHub account, create a new branch for yourself and send a pull request for the merge. After reviewing the changes, we will decide if this is a good place to add your changes.\n\n## Authors and Contributors\n- Rahul Bhadani ( rahulbhadani@email.arizona.edu)\n- Jonathan Sprinkle (sprinkjm@email.arizona.edu)\n- Gustavo Lee (gustavolee@email.arizona.edu)\n- Matthew Nice (matthew.nice@vanderbilt.edu)\n- George Gunter (gunter.gl@gmail.com)\n- Safwan Elmadani (safwanelmadani@email.arizona.edu)\n\n## Licensing\n\n    License: MIT License \n    Copyright 2019-2020 Rahul Bhadani, Jonathan Sprinkle, Arizona Board of Regents\n    Initial Date: Nov 12, 2019\n    Permission is hereby granted, free of charge, to any person obtaining \n    a copy of this software and associated documentation files \n    (the \"Software\"), to deal in the Software without restriction, including\n    without limitation the rights to use, copy, modify, merge, publish,\n    distribute, sublicense, and/or sell copies of the Software, and to \n    permit persons to whom the Software is furnished to do so, subject \n    to the following conditions:\n\n    The above copyright notice and this permission notice shall be \n    included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF \n    ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED \n    TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A \n    PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT \n    SHALL THE AUTHORS, COPYRIGHT HOLDERS OR ARIZONA BOARD OF REGENTS\n    BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN \n    AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \n    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE \n    OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n","funding_links":[],"categories":["Utils"],"sub_categories":["Python Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmscslgroup%2Fstrym","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmscslgroup%2Fstrym","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmscslgroup%2Fstrym/lists"}