{"id":21713568,"url":"https://github.com/adriangalilea/streamlit-shortcuts","last_synced_at":"2025-04-06T02:10:43.283Z","repository":{"id":209738964,"uuid":"724827583","full_name":"adriangalilea/streamlit-shortcuts","owner":"adriangalilea","description":"Streamlit keyboard shortcuts for your buttons.","archived":false,"fork":false,"pushed_at":"2024-10-08T20:44:59.000Z","size":270,"stargazers_count":37,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T01:07:42.288Z","etag":null,"topics":["streamlit","streamlit-component"],"latest_commit_sha":null,"homepage":"https://shortcuts.streamlit.app/","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/adriangalilea.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2023-11-28T21:52:42.000Z","updated_at":"2025-02-20T14:39:05.000Z","dependencies_parsed_at":"2023-11-28T23:26:39.398Z","dependency_job_id":"32c40413-bcc2-418e-bef7-60efca4c7684","html_url":"https://github.com/adriangalilea/streamlit-shortcuts","commit_stats":null,"previous_names":["adriangalilea/streamlit-shortcuts"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriangalilea%2Fstreamlit-shortcuts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriangalilea%2Fstreamlit-shortcuts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriangalilea%2Fstreamlit-shortcuts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriangalilea%2Fstreamlit-shortcuts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adriangalilea","download_url":"https://codeload.github.com/adriangalilea/streamlit-shortcuts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423515,"owners_count":20936626,"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","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":["streamlit","streamlit-component"],"created_at":"2024-11-26T00:18:07.384Z","updated_at":"2025-04-06T02:10:43.231Z","avatar_url":"https://github.com/adriangalilea.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Streamlit Shortcuts\n\nStreamlit Shortcuts allows you to easily add keyboard shortcuts to your Streamlit buttons.\n\n[Live demo](https://shortcuts.streamlit.app/) \u003c- [`example.py`](./example.py)\n\n![screenshot](media/screenshot.png)\n _triggering function with a keyboard shortcut_.\n\n\n\n⭐ New in v0.1.9\n- More robust logic.\n- Simplified usage.\n- Bug fixes.\n- New [`example.py`](./example.py).\n\n## Installation\n\n```bash\npip install streamlit-shortcuts\n```\n\n## Example\n\nCheck out the `example.py` file in the repository for a complete working example. Here's a different snippet:\n\n```python\nimport streamlit as st\nfrom streamlit_shortcuts import button, add_keyboard_shortcuts\n\ndef greet(name):\n    st.success(f\"Hello, {name}!\")\n\nbutton(\"Greet\", \"ctrl+shift+g\", greet, hint=True, args=(\"World\",))\n\n```\n\nTo run the example, clone the repository and execute:\n\n```bash\nstreamlit run example.py\n```\n\nThis will launch a Streamlit app demonstrating various ways to use streamlit-shortcuts.\n\nExtra: define shortcut function with a lambda:\n\n```python\nif button(\"Click me!\", \"ctrl+shift+c\", lambda: st.success(\"Button clicked!\"), hint=True):\n    st.write(\"Button was clicked\") \n```\n\n## Keys\n- Modifiers: 'Ctrl', 'Shift', 'Alt', 'Meta' ('Cmd' on Mac or 'Win' on Windows, thanks to @toolittlecakes)  \n- Common Keys: 'Enter', 'Escape', 'Space'\n- Arrow Keys: 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'\n\nExamples of Key Combinations:\n- 'Ctrl+Enter'\n- 'Shift+ArrowUp'\n- 'Alt+Space'\n\nFor a complete list of key values, refer to:\nhttps://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values\n\n\n## Versioning\n\nWe use semantic versioning. The current version is stored in the `VERSION` file in the root of the repository.\n\n## Contributing\n\nContributions are welcome! If you have suggestions for improvements or bug fixes, please follow these steps:\n\n1. Fork the repository\n2. Create a new branch for your feature or bugfix\n3. Make your changes\n4. Add or update tests as necessary\n5. Update the `VERSION` file if your changes warrant a version bump\n6. Submit a pull request\n\nPlease make sure to update tests as appropriate and adhere to the existing coding style.\n\n## Releasing New Versions\n\nTo release a new version:\n\n1. Update the `VERSION` file with the new version number\n2. Commit the change: `git commit -am \"Bump version to X.Y.Z\"`\n3. Create a new tag: `git tag vX.Y.Z`\n4. Push the changes and the tag: `git push \u0026\u0026 git push --tags`\n\nThe GitHub Actions workflow will automatically create a new release and publish to PyPI.\n\n## Contributors\n- @toolittlecakes\n    - Added 'Meta' modifier\n- @quantum-ernest\n    - Improved usage ergonomics\n    - Keyboard hints\n- @taylor-ennen\n    - Fixed usage `flow` of code\n\n## Credits\nSolution inspired by:\n- https://github.com/streamlit/streamlit/issues/1291\n- https://gist.github.com/brunomsantiago/e0ab366fc0dbc092c1a5946b30caa9a0\n\nSpecial thanks to @brunomsantiago and @TomJohnH for their initial work on this concept.\n\nWrapped and extended for easier usage by the Streamlit Shortcuts team.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadriangalilea%2Fstreamlit-shortcuts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadriangalilea%2Fstreamlit-shortcuts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadriangalilea%2Fstreamlit-shortcuts/lists"}