{"id":22631867,"url":"https://github.com/alleninstitute/pytic","last_synced_at":"2025-10-09T01:12:02.088Z","repository":{"id":57457790,"uuid":"142944118","full_name":"AllenInstitute/pytic","owner":"AllenInstitute","description":"PyTic - An Object-Oriented Python Wrapper for Pololu Tic Stepper Drivers","archived":false,"fork":false,"pushed_at":"2025-08-01T16:51:17.000Z","size":506,"stargazers_count":12,"open_issues_count":10,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-10-09T01:07:54.732Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/AllenInstitute.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","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}},"created_at":"2018-07-31T01:01:45.000Z","updated_at":"2025-09-03T15:10:15.000Z","dependencies_parsed_at":"2025-04-11T20:10:23.487Z","dependency_job_id":"6886e6d1-859b-4809-aff3-a30c0cc26bf3","html_url":"https://github.com/AllenInstitute/pytic","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/AllenInstitute/pytic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenInstitute%2Fpytic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenInstitute%2Fpytic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenInstitute%2Fpytic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenInstitute%2Fpytic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AllenInstitute","download_url":"https://codeload.github.com/AllenInstitute/pytic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenInstitute%2Fpytic/sbom","scorecard":{"id":12061,"data":{"date":"2025-08-11","repo":{"name":"github.com/AllenInstitute/pytic","commit":"5a9cf59311f7a03aa67400194f8d71758a975325"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Binary-Artifacts","score":8,"reason":"binaries present in source code","details":["Warn: binary detected: pytic/drivers/x64/libpololu-tic-1.dll:1","Warn: binary detected: pytic/drivers/x64/libusbp-1.dll:1"],"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":"Code-Review","score":0,"reason":"Found 0/30 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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":-1,"reason":"no dependencies found","details":null,"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":"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":"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":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Warn: project license file does not contain an FSF or OSI license."],"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: branch protection not enabled for branch 'master'"],"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"}}]},"last_synced_at":"2025-08-14T14:50:56.788Z","repository_id":57457790,"created_at":"2025-08-14T14:50:56.789Z","updated_at":"2025-08-14T14:50:56.789Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000722,"owners_count":26082894,"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-08T02:00:06.501Z","response_time":56,"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":[],"created_at":"2024-12-09T02:13:50.150Z","updated_at":"2025-10-09T01:12:02.071Z","avatar_url":"https://github.com/AllenInstitute.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- PyTic Readme --\u003e\n# PyTic v0.0.4   \n\n![pololu tic](images/pololu_tic.png)\n\n---\n\n## Introduction\n\n`PyTic` is an object-oriented Python wrapper for the Pololu Tic stepper driver series. The wrapper interacts with the stepper driver device using the API described in the [Pololu-Tic-Software][pololu_tic_software] GitHub page using the ctypes library. The device comunication protocol is USB.\n\n---\n\n## Installation\n\n### Prerequisites\n\n`PyTic` requires the [Tic Software and Drivers for Windows][tic_drivers_win] msi provided by Pololu to be installed as a prerequisite. Other operating system drivers can be found on the [Pololu Tic Resources][tic_resources], but are not currently supported by this Python package.\n\n\n### Pip Install\n\nTo install the `PyTic` package on a Windows machine equipped with Python 2.7 or higher, run the following `pip` command:\n\n```console\nC:\\\u003e pip install pytic\n```\n\n* Note: Only Windows x64 machines are supported at this time.\n\n---\n\n\n## Package Architecture\n\n`PyTic` encompasses almost all functionality present in the original C-API with some additional features. The __Pololu Tic Stepper Driver__ is represented in Python using the `pytic.PyTic()` object. \n\n```console\n----------------------------------\n|     Package Relation Tree      |\n----------------------------------\n\nPyTic                 [Tic Object]\n  |-- Settings        [Structure Interface Object]\n      |- Pin Settings [Structure Interface Object] [List]\n  |-- Variables       [Structure Interface Object]\n      |- Pin Info     [Structure Interface Object] [List]\n  |-- Logger          [Notification]\n\nPyTic_Protocol        [Module]\n  |-- Tic Constants   [Dictionary]\n```\n\n### PyTic Protocol (C-Constants Dictionary)\n\u003ca name=\"pytic_protocol\"\u003e\u003c/a\u003e\n\nThe __Pololu Tic C-API__ uses `CAPS_DEFINED_CONSTANTS` for setting many of its parameters that represent an integer value. These contants set parameters such as pin function, step mode, etc. The `PyTic` package auto-imports these values from the [tic_protocol.h][tic_protocol_h] header file and stores them in a Python dictionary named `tic_constants` in the `pytic_protocol` module. See [Using Settings](#using_settings) in the [Example Code](#example_code) section to see how to use this dictionary in contect.\n\n### Error Handling\n\nAll __Pololu Tic C-API__ functions when dynamically imported into `PyTic` are wrapped in a higher-order function error handler called `TED()`, short for __[T]ic [E]rror [D]ecoder__. `TED()` will make all Tic wrapped functions return 0 from a successful call and 1 from a call that generated an error. In addition, `TED()` performs low-level bit mask decoding and writes the enumerated error value to the `PyTic` object internal log. This log can be output the ther terminal or file using the standard [logging][logging_lib] library.\n\n---\n\n## Example Code\n\u003ca name=\"example_code\"\u003e\u003c/a\u003e\n\nOutlined in this section are several examples of how to use `PyTic` to control a __Pololu Tic Stepper Driver__. The objective of this section is to show the `PyTic` syntax used to implement the __Pololu Tic Stepper Driver C-API__ as opposed to detail each of the available functions. For a full list of commands, settings, and variable information please refer to either the [Pololu Tic Manual][pololu_tic_manual], the [Pololu Tic C-API][tic_h], or this package's source code.\n\n### Simple Program\n\u003ca name=\"simple_program\"\u003e\u003c/a\u003e\n\nThe simple program below demonstrates how to connect to a __Pololu Tic Stepper Driver__ device over USB and move to several positions after the previous position has been reached.\n\n```python\nimport pytic\nfrom time import sleep\n\n# - Initialization -------------------------------------------\n\ntic = pytic.PyTic()\n\n# Connect to first available Tic Device serial number over USB\nserial_nums = tic.list_connected_device_serial_numbers()\ntic.connect_to_serial_number(serial_nums[0])\n\n# Load configuration file and apply settings\ntic.settings.load_config('path\\\\to\\\\config.yml')\ntic.settings.apply()                             \n\n# - Motion Command Sequence ----------------------------------\n\n# Zero current motor position\ntic.halt_and_set_position(0)\n\n# Energize Motor\ntic.energize()\ntic.exit_safe_start()\n\n# Move to listed positions\npositions = [1000, 2000, 3000, 0]\nfor p in positions:\n  tic.set_target_position(p)\n  while tic.variables.current_position != tic.variables.target_position:\n    sleep(0.1)\n\n# De-energize motor and get error status\ntic.enter_safe_start()\ntic.deenergize()\nprint(tic.variables.error_status)\n```\n\n* Note: Modified settings will not take effect until `PyTic.settings.apply()` method is called. This is to avoid unnecessary writes to non-volitile memory.\n\n### Using Settings\n\u003ca name=\"using_settings\"\u003e\u003c/a\u003e\n\nThe `PyTic.settings` structure interface object is used to alter device settings stored in non-volitile memory. As detailed above in [PyTic Protocol](#pytic_protocol), some of these settings have enumerated constants to maintain a user-friendly interaction. The code sample below demonstrates how to interact with `PyTic.settings` using the `tic_constant` dictionary. To avoid unnecissary writes to non-volitile memory, the `PyTic.settings.apply()` function must be called for the new settings to take effect.\n\n```python\n\n# ... assume PyTic object initialized and connected to device as 'tic'\n\n# Load Tic Constant Dictionary\ntc = pytic.pytic_protocol.tic_constant\n\n# Modify individual properties of composite settings object\ntic.settings.product = tc['TIC_PRODUCT_T825']\ntic.settings.step_mode = tc['TIC_STEP_MODE_MICROSTEP16']\n\n# Turn the Serial RX Pin into a generic digital user input\npin = tc['TIC_PIN_NUM_RX']\ntic.settings.pin_setting[pin].func = tc['TIC_PIN_FUNC_USER_INPUT']\ntic.settings.pin_setting[pin].pullup = True\n\n# Required to burn new settings to Tic non-volitile memory\ntic.settings.apply()\n\n```\n\n\n\u003c!---### Using Variables\n\n```python\n\n#quick pin examples\n\n```\n---\u003e\n\n---\n## Logging\n\n`PyTic` uses the `logging` package to display Tic status messages. The default logging level is `logging.DEBUG`. For less verbose logging, set `PyTic.log_level = logging.CRITICAL`. The log name is `PyTic` for users that would like to have a parent-object handle the logging information.\n\n\n---\n## Example YAML Configuration File\n\n`PyTic` settings can be set invidually using the `PyTic.settings` structure interface in the script or all-at-once using a YAML config file and the `PyTic.settings.load_config('\\\\path\\\\to\\\\config.yml')` function. Here is an example YAML config file with some usage notes,\n\n```yaml\ntic_settings:                             # required header for load_config fcn.\n  product: TIC_PRODUCT_T825    \n  auto_clear_driver_error: True           # ** These 4 settings         **\n  ignore_err_line_high: True              # ** were experimentally      **\n  serial_crc_enabled: False               # ** determined to stabalize  **\n  command_timeout: 0                      # ** device performance       **\n  max_speed: 180000000                    # pulses/s * 10^-4\n  starting_speed: 0                       # pulses/s * 10^-4\n  max_accel: 9000000                      # pulses/s^2 * 10^-2\n  max_decel: 9000000                      # pulses/s^2 * 10^-2\n  step_mode: TIC_STEP_MODE_MICROSTEP16 \n  current_limit: 640                    # mA, Only select values acceptable, See notes.\n  decay_mode: TIC_DECAY_MODE_T825_FAST \n  pin_settings:                         # Ex. Modifying Default Pin Fcn.\n    - pin_num: TIC_PIN_NUM_RX\n      func: TIC_PIN_FUNC_USER_INPUT\n      pullup: True\n      analog: False\n    # - pin_id: TIC_PIN_NUM_TX          # ... modifying a 2nd pin ...\n    #   func: TIC_PIN_FUNC_USER_INPUT\n    #   polarity: True\n    #   analog: False\n```\n\nNotes:\n* `CAPS_DEFINED_CONSTANTS` are keys for the `tic_constant` dictionary located in `pytic_protocol.py`. Refer to section [Using Settings](#using_settings) for more details on the dictionary and its use. \n* `current_limit` only accepts select values detailed in the [Pololu Tic Manual][pololu_tic_manual]\n\n \n---\n\n## Dependencies\n\nDependencies include the following,\n\n* PyYAML\n\n---\n\n## Level of Support Notice\n\nThis code is currently not supported. It is being released to the community AS IS without any guarantee of support. The community is welcome to submit issues, but should not expect an active response.\n\n---\n\n## External Resources\n\nExternal resources include the following,\n\n* [logging Library][logging_lib]\n* [Pololu-Tic-Software GitHub][pololu_tic_software]\n* [Pololu Tic Manual][pololu_tic_manual]\n* [Pololu Tic Resources][tic_resources]\n* [tic.h][tic_h]\n* [tic_protocol.h][tic_protocol_h]\n* [Tic Software and Drivers for Windows][tic_drivers_win]\n\n[pololu_tic_software]: https://github.com/pololu/pololu-tic-software\n[pololu_tic_manual]: https://www.pololu.com/docs/0J71\n[logging_lib]: https://docs.python.org/3/library/logging.html\n[tic_protocol_h]: https://github.com/pololu/pololu-tic-software/blob/a75c204a2255554e21cc5351c528d930ba5d2c38/include/tic_protocol.h\n[tic_drivers_win]: https://www.pololu.com/file/0J1325/pololu-tic-1.6.2-win.msi\n[tic_resources]:https://www.pololu.com/product/3131/resources\n[tic_h]: https://github.com/pololu/pololu-tic-software/blob/master/include/tic.h","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falleninstitute%2Fpytic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falleninstitute%2Fpytic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falleninstitute%2Fpytic/lists"}