{"id":31572070,"url":"https://github.com/chaitu-ycr/py_canoe","last_synced_at":"2025-10-05T13:48:04.133Z","repository":{"id":65143238,"uuid":"579579318","full_name":"chaitu-ycr/py_canoe","owner":"chaitu-ycr","description":"Python 🐍 Package for controlling Vector CANoe 🛶 Tool","archived":false,"fork":false,"pushed_at":"2025-09-12T12:50:32.000Z","size":4750,"stargazers_count":85,"open_issues_count":7,"forks_count":52,"subscribers_count":3,"default_branch":"dev","last_synced_at":"2025-09-12T14:59:04.985Z","etag":null,"topics":["canoe","python","vector"],"latest_commit_sha":null,"homepage":"https://chaitu-ycr.github.io/py_canoe/","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/chaitu-ycr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"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":{"github":"chaitu-ycr","buy_me_a_coffee":"chaitu.ycr"}},"created_at":"2022-12-18T06:41:56.000Z","updated_at":"2025-09-09T12:39:28.000Z","dependencies_parsed_at":"2023-09-26T23:01:21.310Z","dependency_job_id":"500040b8-6136-45f4-a9e3-efee2033324c","html_url":"https://github.com/chaitu-ycr/py_canoe","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":0.03448275862068961,"last_synced_commit":"ae4eb54cda3deb0cab94a31d8ce2ecca54b34cdb"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/chaitu-ycr/py_canoe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaitu-ycr%2Fpy_canoe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaitu-ycr%2Fpy_canoe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaitu-ycr%2Fpy_canoe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaitu-ycr%2Fpy_canoe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaitu-ycr","download_url":"https://codeload.github.com/chaitu-ycr/py_canoe/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaitu-ycr%2Fpy_canoe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278464300,"owners_count":25991177,"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-10-05T02:00:06.059Z","response_time":54,"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":["canoe","python","vector"],"created_at":"2025-10-05T13:48:03.243Z","updated_at":"2025-10-05T13:48:04.124Z","avatar_url":"https://github.com/chaitu-ycr.png","language":"Python","funding_links":["https://github.com/sponsors/chaitu-ycr","https://buymeacoffee.com/chaitu.ycr"],"categories":[],"sub_categories":[],"readme":"# [py_canoe](https://github.com/chaitu-ycr/py_canoe)\n\n## about package\n\nPython 🐍 Package for accessing Vector CANoe 🛶 Tool\n\n## important links\n\n- [🔗 github documentation](https://chaitu-ycr.github.io/py_canoe/)\n- [🔗 pypi package](https://pypi.org/project/py_canoe/)\n- [🔗 github releases](https://github.com/chaitu-ycr/py_canoe/releases)\n- [🔗 for ideas💡/sugessions please create new discussion **here**](https://github.com/chaitu-ycr/py_canoe/discussions)\n- [🔗 create issue or request feature **here**](https://github.com/chaitu-ycr/py_canoe/issues/new/choose)\n- [🔗 fork repo](https://github.com/chaitu-ycr/py_canoe/fork) and create pull request to contribute back to this project.\n\n## prerequisites\n\n- [Python(\u003e=3.10)](https://www.python.org/downloads/)\n- [Vector CANoe software(\u003e=v11)](https://www.vector.com/int/en/support-downloads/download-center/)\n- Vector CANoe license. Also works with Demo version of CANoe with limited functionalities.\n- [visual studio code](https://code.visualstudio.com/Download)\n- Windows PC(recommended windows 11 OS along with 16GB RAM)\n\n## setup and installation\n\ncreate python virtual environment\n\n```\npython -m venv .venv\n```\n\nactivate virtual environment\n\n```\n.venv\\Scripts\\activate\n```\n\nupgrade pip (optional)\n\n```\npython -m pip install pip --upgrade\n```\n\nInstall [**py_canoe**](https://pypi.org/project/py_canoe/) package\n\n```\npip install py_canoe --upgrade\n```\n\n---\n\n## example use cases\n\n### import CANoe module and create CANoe object instance\n\n```python\nfrom py_canoe import CANoe, wait\n\ncanoe_inst = CANoe()\n```\n\n### open CANoe, start measurement, get version info, stop measurement and close canoe configuration\n\n```python\ncanoe_inst.open(canoe_cfg=r'tests\\demo_cfg\\demo.cfg')\n\ncanoe_inst.start_measurement()\ncanoe_version_info = canoe_inst.get_canoe_version_info()\ncanoe_inst.stop_measurement()\ncanoe_inst.quit()\n```\n\n### restart/reset running measurement\n\n```python\ncanoe_inst.open(canoe_cfg=r'tests\\demo_cfg\\demo.cfg')\n\ncanoe_inst.start_measurement()\ncanoe_inst.reset_measurement()\ncanoe_inst.stop_ex_measurement()\n```\n\n### open CANoe offline config and start/break/step/reset/stop measurement in offline mode\n\n```python\ncanoe_inst.open(r'tests\\demo_cfg\\demo_offline.cfg')\n\ncanoe_inst.add_offline_source_log_file(r'tests\\demo_cfg\\Logs\\demo_log.blf')\ncanoe_inst.start_measurement_in_animation_mode(animation_delay=200)\ncanoe_inst.break_measurement_in_offline_mode()\ncanoe_inst.step_measurement_event_in_single_step()\ncanoe_inst.reset_measurement_in_offline_mode()\ncanoe_inst.stop_measurement()\n```\n\n### get/set CANoe measurement index\n\n```python\ncanoe_inst.open(canoe_cfg=r'tests\\demo_cfg\\demo_dev.cfg')\n\nmeas_index_value = canoe_inst.get_measurement_index()\ncanoe_inst.start_measurement()\ncanoe_inst.stop_measurement()\nmeas_index_value = canoe_inst.get_measurement_index()\ncanoe_inst.set_measurement_index(meas_index_value + 1)\nmeas_index_new = canoe_inst.get_measurement_index()\ncanoe_inst.reset_measurement()\ncanoe_inst.stop_measurement()\n```\n\n### save CANoe config to a different version with different name\n\n```python\ncanoe_inst.open(canoe_cfg=r'tests\\demo_cfg\\demo_dev.cfg')\n\ncanoe_inst.save_configuration_as(path=r'tests\\demo_cfg\\demo_v10.cfg', major=10, minor=0, create_dir=True)\n```\n\n### get CAN bus statistics of CAN channel 1\n\n```python\ncanoe_inst.open(canoe_cfg=r'tests\\demo_cfg\\demo_dev.cfg')\n\ncanoe_inst.start_measurement()\ncanoe_inst.get_can_bus_statistics(channel=1)\ncanoe_inst.stop_measurement()\n```\n\n### get/set bus signal value, check signal state and get signal full name\n\n```python\ncanoe_inst.open(canoe_cfg=r'tests\\demo_cfg\\demo_dev.cfg')\n\ncanoe_inst.start_measurement()\nsig_full_name = canoe_inst.get_signal_full_name(bus='CAN', channel=1, message='LightState', signal='FlashLight')\nsig_value = canoe_inst.get_signal_value(bus='CAN', channel=1, message='LightState', signal='FlashLight', raw_value=False)\ncanoe_inst.set_signal_value(bus='CAN', channel=1, message='LightState', signal='FlashLight', value=1, raw_value=False)\nsig_online_state = canoe_inst.check_signal_online(bus='CAN', channel=1, message='LightState', signal='FlashLight')\nsig_state = canoe_inst.check_signal_state(bus='CAN', channel=1, message='LightState', signal='FlashLight')\nsig_val = canoe_inst.get_signal_value(bus='CAN', channel=1, message='LightState', signal='FlashLight', raw_value=True)\ncanoe_inst.stop_measurement()\n```\n\n### clear write window / read text from write window / control write window output file\n\n```python\ncanoe_inst.open(canoe_cfg=r'tests\\demo_cfg\\demo_dev.cfg')\n\ncanoe_inst.enable_write_window_output_file(r'tests\\demo_cfg\\Logs\\write_win.txt')\ncanoe_inst.start_measurement()\ncanoe_inst.clear_write_window_content()\ncanoe_inst.write_text_in_write_window(\"hello from py_canoe!\")\ntext = canoe_inst.read_text_from_write_window()\ncanoe_inst.stop_measurement()\ncanoe_inst.disable_write_window_output_file()\n```\n\n### switch between CANoe desktops\n\n```python\ncanoe_inst.open(canoe_cfg=r'tests\\demo_cfg\\demo_dev.cfg')\ncanoe_inst.ui_activate_desktop('Configuration')\n```\n\n### get/set system variable or define system variable\n\n```python\ncanoe_inst.open(canoe_cfg=r'tests\\demo_cfg\\demo_dev.cfg')\n\ncanoe_inst.start_measurement()\ncanoe_inst.set_system_variable_value('demo::level_two_1::sys_var2', 20)\ncanoe_inst.set_system_variable_value('demo::string_var', 'hey hello this is string variable')\ncanoe_inst.set_system_variable_value('demo::data_var', 'hey hello this is data variable')\ncanoe_inst.set_system_variable_array_values('demo::int_array_var', (00, 11, 22, 33, 44, 55, 66, 77, 88, 99))\nsys_var_val = canoe_inst.get_system_variable_value('demo::level_two_1::sys_var2')\nsys_var_val = canoe_inst.get_system_variable_value('demo::data_var')\ncanoe_inst.stop_measurement()\ncanoe_inst.define_system_variable('sys_demo::demo', 1)\ncanoe_inst.save_configuration()\ncanoe_inst.start_measurement()\nsys_var_val = canoe_inst.get_system_variable_value('sys_demo::demo')\ncanoe_inst.stop_measurement()\n```\n\n### send diagnostic request, control tester present\n\n```python\ncanoe_inst.open(r'tests\\demo_cfg\\demo_diag.cfg')\n\ncanoe_inst.start_measurement()\nresp = canoe_inst.send_diag_request('Door', 'DefaultSession_Start', False)\ncanoe_inst.control_tester_present('Door', False)\nwait(2)\ncanoe_inst.control_tester_present('Door', True)\nwait(5)\nresp = canoe_inst.send_diag_request('Door', '10 02')\ncanoe_inst.control_tester_present('Door', False)\nwait(2)\nresp = canoe_inst.send_diag_request('Door', '10 03', return_sender_name=True)\ncanoe_inst.stop_measurement()\n```\n\n### set replay block source file / control replay block start stop\n\n```python\ncanoe_inst.open(canoe_cfg=r'tests\\demo_cfg\\demo_dev.cfg')\n\ncanoe_inst.start_measurement()\ncanoe_inst.set_replay_block_file(block_name='DemoReplayBlock', recording_file_path=r'tests\\demo_cfg\\Logs\\demo_log.blf')\ncanoe_inst.control_replay_block(block_name='DemoReplayBlock', start_stop=True)\nwait(2)\ncanoe_inst.control_replay_block(block_name='DemoReplayBlock', start_stop=False)\ncanoe_inst.stop_measurement()\n```\n\n### compile CAPL nodes and call capl function\n\n```python\ncanoe_inst.open(canoe_cfg=r'tests\\demo_cfg\\demo_dev.cfg')\n\ncanoe_inst.compile_all_capl_nodes()\ncanoe_inst.start_measurement()\ncanoe_inst.call_capl_function('addition_function', 100, 200)\ncanoe_inst.call_capl_function('hello_world')\ncanoe_inst.stop_measurement()\n```\n\n### execute test setup test module / test environment\n\n```python\ncanoe_inst.open(canoe_cfg=r'tests\\demo_cfg\\demo_dev.cfg')\n\ncanoe_inst.start_measurement()\ncanoe_inst.execute_all_test_modules_in_test_env(demo_test_environment)\ncanoe_inst.execute_test_module('demo_test_node_002')\ncanoe_inst.stop_measurement()\n```\n\n### get/set environment variable value\n\n```python\ncanoe_inst.open(canoe_cfg=r'tests\\demo_cfg\\demo_dev.cfg')\n\ncanoe_inst.start_measurement()\ncanoe_inst.set_environment_variable_value('int_var', 123.12)\ncanoe_inst.set_environment_variable_value('float_var', 111.123)\ncanoe_inst.set_environment_variable_value('string_var', 'this is string variable')\ncanoe_inst.set_environment_variable_value('data_var', (1, 2, 3, 4, 5, 6, 7))\nvar_value = canoe_inst.get_environment_variable_value('int_var')\nvar_value = canoe_inst.get_environment_variable_value('float_var')\nvar_value = canoe_inst.get_environment_variable_value('string_var')\nvar_value = canoe_inst.get_environment_variable_value('data_var')\ncanoe_inst.stop_measurement()\n```\n\n### add/remove database\n\n```python\ncanoe_inst.open(canoe_cfg=r\"tests\\demo_cfg\\demo_conf_gen_db_setup.cfg\")\n\ncanoe_inst.start_measurement()\n# add database\ncanoe_inst.add_database(fr\"{file_path}\\demo_cfg\\DBs\\sample_databases\\XCP.dbc\", 'CAN1', 1)\n# remove database\ncanoe_inst.remove_database(fr\"{file_path}\\demo_cfg\\DBs\\sample_databases\\XCP.dbc\", 1)\n```\n\n### start/stop online logging block\n\n```python\ncanoe_inst.open(canoe_cfg=r\"tests\\demo_cfg\\demo_online_setup.cfg\")\n\ncanoe_inst.start_measurement()\n# stop logging block\ncanoe_inst.start_stop_online_logging_block(fr'{demo_cfg_dir}\\Logs\\demo_online_setup_log.blf', start_stop=False)\nwait(2)\n# start logging block\ncanoe_inst.start_stop_online_logging_block(fr'{demo_cfg_dir}\\Logs\\demo_online_setup_log.blf', start_stop=True)\n```\n\n### working with logging blocks\n\n```python\n# remove current logging blocks\nfor i in range(canoe_inst.logging_collection.count):\n    canoe_inst.remove_logging_block(1)  # iteration start from 1 and shifts after each delete\n# add a new block\n# define dest path with file format as asc, blf or other\n# may include field functions like {IncMeasurement}\nfull_path = \"C:/sample_log_{IncMeasurement}.blf\"\ncanoe_inst.add_logging_block(full_path)\ncanoe_inst.start_measurement()\n# ...\ncanoe_inst.stop_measurement()\n# log should be fully generated at this point for you to analyze\ncanoe_inst.set_configuration_modified(False)  # to avoid popup asking to save changes\ncanoe_inst.quit()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaitu-ycr%2Fpy_canoe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaitu-ycr%2Fpy_canoe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaitu-ycr%2Fpy_canoe/lists"}