{"id":20336623,"url":"https://github.com/dnknth/snips-skill","last_synced_at":"2026-05-07T23:08:18.850Z","repository":{"id":44158135,"uuid":"211654713","full_name":"dnknth/snips-skill","owner":"dnknth","description":"A small utility package to simplify the development of Snips client applications in Python","archived":false,"fork":false,"pushed_at":"2025-07-28T21:06:01.000Z","size":141,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-25T11:54:32.403Z","etag":null,"topics":["mqtt","python3","snips"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"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/dnknth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2019-09-29T11:48:10.000Z","updated_at":"2025-07-28T21:06:04.000Z","dependencies_parsed_at":"2025-01-14T16:53:11.500Z","dependency_job_id":"ee7c3a4a-1e1d-4cde-bd2e-72ee86395b4f","html_url":"https://github.com/dnknth/snips-skill","commit_stats":{"total_commits":34,"total_committers":1,"mean_commits":34.0,"dds":0.0,"last_synced_commit":"09692a90cdb8acdbf8f4f3f0014607b719cf630e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dnknth/snips-skill","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnknth%2Fsnips-skill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnknth%2Fsnips-skill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnknth%2Fsnips-skill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnknth%2Fsnips-skill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dnknth","download_url":"https://codeload.github.com/dnknth/snips-skill/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnknth%2Fsnips-skill/sbom","scorecard":{"id":348688,"data":{"date":"2025-08-11","repo":{"name":"github.com/dnknth/snips-skill","commit":"8795b6f4adb678bccf02a1b6d15cd6eada03bb40"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.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":"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":"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":"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":"Maintained","score":0,"reason":"1 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":"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":"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/ci.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/dnknth/snips-skill/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/dnknth/snips-skill/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/dnknth/snips-skill/ci.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:20","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:21","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:25","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   3 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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt: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: 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-18T07:47:02.961Z","repository_id":44158135,"created_at":"2025-08-18T07:47:02.961Z","updated_at":"2025-08-18T07:47:02.961Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32759459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["mqtt","python3","snips"],"created_at":"2024-11-14T21:06:09.253Z","updated_at":"2026-05-07T23:08:18.843Z","avatar_url":"https://github.com/dnknth.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# snips-skill\n\nHelpers to keep [Snips](https://snips.ai) skills in Python3 free of boilerplate code.\n\nSnips used to be a French company with a decent voice assistant.\nThey were bought by [Sonos](https://www.sonos.com/) and discontinued all services.\nSnips also created the [Hermes](https://github.com/snipsco/hermes-protocol) MQTT protocol,\nwhich is compatible with the [Rhasspy](https://github.com/rhasspy/rhasspy) voice assistant.\n\nA 'skill' (in Snips parlance) is an MQTT client that may read sensors,\ndo computations, or trigger devices.\n\n## Contents\n\n- `MqttClient`: A thin wrapper around [paho-mqtt](https://www.eclipse.org/paho/clients/python/docs/)\n- `CommandLineClient` skeleton MQTT command line client with connection settings.\n- `SnipsClient`: Reads connection parameters from `/etc/snips/toml`\n- Snips-specific decorators for callbacks, see below.\n- `MultiRoomConfig`: Utilities for multi-room setups.\n- `Skill`: Base class for Snips actions.\n- `@intent` decorator, see below.\n- `StateAwareMixin` with `@when` and `@conditional` decorators for stateful MQTT clients.\n\n## Plain MQTT clients\n\nPlain MQTT is supported via the `MqttClient` and `CommandLineClient` classes\nand the `@topic` decorator.\n\nA `CommandLineClient` provides argument parsing for connection parameters and includes\nstandard logging. For message handling, define a function or method as\nabove, and decorate it with `@topic`. This registers the method (or function)\nas a callback for the given MQTT topic.\n\n### Usage example\n\n```python\nfrom snips_skill import CommandLineClient, topic\n\nclass Logger(CommandLineClient):\n    'Log all incoming MQTT messages'\n    \n    @topic('#')\n    def print_msg(self, userdata, msg):\n        self.log.info(\"%s: %s\", msg.topic, msg.payload[:64])\n\nif __name__ == '__main__':\n    Logger().run()\n```\n\n## Snips session event decorators\n\nThe `Skill` class provides automatic connection configuration via `/etc/snips/toml`.\nAlso, the following Snips-specific decorators for session events are provided:\n\n- `on_intent`: Handle intents,\n- `on_intent_not_recognized`: Handle unknown intents,\n- `on_start_session`: Called before session start,\n- `on_continue_session`: Called for subsequent session prompts,\n- `on_session_started`: Called at session start,\n- `on_end_session`: Called before session end,\n- `on_session_ended`: Called at session end.\n\nAll decorators can be used either on standalone callback functions,\nor on methods of the various client classes (including `Skill`).\n\nMethods should expect the parameters `self, userdata, msg`, and\nstandalone functions should expect `client, userdata, msg`.\n\nMultiple decorators on the same method are possible,\nbut if they have inconsistent `qos` values, the results will be unpredictable.\nAlso note that multiple decorators will produce repetitive log lines\nwith `DEBUG` level. Set `log_level=None` on all but one decorator to fix it.\n\n## The `@intent` decorator\n\n`@intent`-decorated callbacks receive `msg.paylod`\nas an `IntentPayload` object, a parsed version of the JSON intent data.\nSlot values are converted to appropriate Python types.\n\nThe next step in the Snips session depends on the outcome of the decorated function or method:\n\n- If the function returns a string or raises a `SnipsError`, the session ends with a message,\n- If it returns en empty string, the session is ended silently.\n- If it raises a `SnipsClarificationError`, the session is continued with a question. This can be used to narrow down parameters or to implement question-and-answer sequences.\n\nTo require a minimum level of confidence for an intent,\nput `@min_confidence` below `@intent`.\n\nTo ensure that certain slots are present in the intent,\nput `@require_slot` with a slot name below `@intent`.\n\nThe `@intent` decorator should not be used in combination with any `on_*` decorators.\n\n### Example usage\n\n```python\nfrom snips_skill import intent, Skill\n\nclass HelloSkill(Skill):\n    'Snips skill to say hello'\n    \n    @intent('example:hello')\n    def say_hello(self, userdata, msg):\n        return 'Hello, there'\n        \nif __name__ == '__main__':\n    HelloSkill().run()\n```\n\n## `StateAwareMixin`, `@when` and `@conditional` decorators\n\nThese define actions triggered by state changes on MQTT.\nExample: _Sensor registers motion -\u003e switch the light on_\n\nClients can use `StateAwareMixin` to track the last known state\nof relevant topics. For that, a `status_topic` needs to be configured\nin the global section of `config.ini`.\nTopics and payloads are kept in `self.current_state`.\n\nChange handlers should be decorated with either `@when` or `@conditional`.\nThe former triggers the handler whenever a boolean condition on the current\nstate is fulfilled, the latter whenever a MQTT topic relevant for the given boolean condition changes.\n\n### Usage\n\n```python\n\n  @when('topic/a \u003e 0')\n  def topic_a_handler(self):\n    ... # do something\n  \n  @conditional('topic/a != 0 or topic/b != 0')\n  def topic_a_or_b_handler(self, on):\n    if on:\n      ... # switch something on\n    else:\n      ... # switch it off\n```\n\nBoolean expressions, numeric comparisons, string (in)equality\nand string matching with regular expressions are supported.\nAs usual, parentheses can be used to control the evaluation order.\n\nSee `test_expr.py` for the exact grammar.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnknth%2Fsnips-skill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdnknth%2Fsnips-skill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnknth%2Fsnips-skill/lists"}