{"id":14964354,"url":"https://github.com/openstenoproject/plover_python_dictionary","last_synced_at":"2025-10-16T08:51:16.230Z","repository":{"id":57453587,"uuid":"72784795","full_name":"openstenoproject/plover_python_dictionary","owner":"openstenoproject","description":"Python dictionaries support for Plover","archived":false,"fork":false,"pushed_at":"2025-07-09T17:48:28.000Z","size":35,"stargazers_count":19,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-10T02:08:57.230Z","etag":null,"topics":["plover"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openstenoproject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2016-11-03T20:39:39.000Z","updated_at":"2025-07-09T17:48:02.000Z","dependencies_parsed_at":"2024-09-13T22:52:42.065Z","dependency_job_id":null,"html_url":"https://github.com/openstenoproject/plover_python_dictionary","commit_stats":{"total_commits":59,"total_committers":2,"mean_commits":29.5,"dds":"0.016949152542372836","last_synced_commit":"8ff565b892f5e2153adfc800fd9a5b2c90989862"},"previous_names":["benoit-pierre/plover_python_dictionary"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/openstenoproject/plover_python_dictionary","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstenoproject%2Fplover_python_dictionary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstenoproject%2Fplover_python_dictionary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstenoproject%2Fplover_python_dictionary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstenoproject%2Fplover_python_dictionary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openstenoproject","download_url":"https://codeload.github.com/openstenoproject/plover_python_dictionary/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstenoproject%2Fplover_python_dictionary/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266626115,"owners_count":23958344,"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-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["plover"],"created_at":"2024-09-24T13:33:04.107Z","updated_at":"2025-10-16T08:51:11.178Z","avatar_url":"https://github.com/openstenoproject.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plover Python dictionary\n\nAdd support for Python dictionaries to Plover.\n\n\n## Usage\n\nA Python dictionary is simply a single UTF-8 source file with the following API:\n\n``` python\n# Length of the longest supported key (number of strokes).\nLONGEST_KEY = 1\n\n# Lookup function: return the translation for \u003ckey\u003e (a tuple of strokes)\n# or raise KeyError if no translation is available/possible.\ndef lookup(key):\n    assert len(key) \u003c= LONGEST_KEY\n    raise KeyError\n\n# Optional: return an array of stroke tuples that would translate back\n# to \u003ctext\u003e (an empty array if not possible).\ndef reverse_lookup(text):\n    return []\n```\n\nFor example save the following code to `show_stroke.py`:\n\n\u003e **Note**: make sure the file encoding is UTF-8!\n\n``` python\nLONGEST_KEY = 2\n\nSHOW_STROKE_STENO = 'STR*'\n\ndef lookup(key):\n    assert len(key) \u003c= LONGEST_KEY, '%d/%d' % (len(key), LONGEST_KEY)\n    if SHOW_STROKE_STENO != key[0]:\n        raise KeyError\n    if len(key) == 1:\n        return ' '\n    return key[1]\n```\n\nThen add it to your dictionaries stack as you would a normal dictionary.\n\nNow, if you stroke `STR*`, then the next stroke will be shown verbatim\n(untranslated), e.g. `-T STROEBG TP-R KW-GS STROEBG KR-GS S STR* STROEBG`\noutputs: `the stroke for \"stroke\" is STROEBG`.\n\n\n## Release history\n\n### 1.2.0\n\n* use importlib instead of exec ([#12](https://github.com/openstenoproject/plover_python_dictionary/pull/12))\n\n### 1.1.0\n\n* fix type checks for `lookup` and `reverse_lookup`:\n  allow bound methods and functors\n* fix `reverse_lookup` implementation: return a set.\n* fix `__getitem__` / `get` implementations:\n  when the key length is out of bounds\n* fix `__contains__` implementation\n* fix `__delitem__` / `__setitem__` implementations:\n  raise the correct exception type\n\n### 1.0.0\n\n* fix possible encoding issue when loading a dictionary:\n  from now on, assume and force UTF-8\n\n### 0.5.12\n\n* update changelog...\n\n### 0.5.11\n\n* drop support for Python \u003c 3.6\n* fix use of deprecated `imp` module\n* rework tests to use `plover_build_utils.testing`\n* use PEP 517/518\n\n### 0.5.10\n\n* fix `./setup.py test` handling\n* fix default implementation of `reverse_lookup` to return a list (not a tuple)\n\n### 0.5.9\n\n* update to Plover's latest API\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenstenoproject%2Fplover_python_dictionary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenstenoproject%2Fplover_python_dictionary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenstenoproject%2Fplover_python_dictionary/lists"}