{"id":28438908,"url":"https://github.com/haloroute/st-clipboard","last_synced_at":"2026-03-14T08:40:49.866Z","repository":{"id":297259151,"uuid":"995977638","full_name":"Haloroute/st-clipboard","owner":"Haloroute","description":"PyPI package","archived":false,"fork":false,"pushed_at":"2025-06-04T17:35:52.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-28T23:43:04.562Z","etag":null,"topics":["clipboard","http","https","python","streamlit"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/st-clipboard/","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/Haloroute.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,"zenodo":null}},"created_at":"2025-06-04T09:24:46.000Z","updated_at":"2025-06-04T17:42:56.000Z","dependencies_parsed_at":"2025-06-08T06:15:14.576Z","dependency_job_id":null,"html_url":"https://github.com/Haloroute/st-clipboard","commit_stats":null,"previous_names":["haloroute/st-clipboard"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Haloroute/st-clipboard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haloroute%2Fst-clipboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haloroute%2Fst-clipboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haloroute%2Fst-clipboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haloroute%2Fst-clipboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Haloroute","download_url":"https://codeload.github.com/Haloroute/st-clipboard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Haloroute%2Fst-clipboard/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266285545,"owners_count":23905376,"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":["clipboard","http","https","python","streamlit"],"created_at":"2025-06-06T01:40:35.533Z","updated_at":"2026-03-14T08:40:49.783Z","avatar_url":"https://github.com/Haloroute.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clipboard Copy Utilities for Streamlit\n\nThis Python package provides easy-to-use functions to copy text to the clipboard\nwithin Streamlit applications, supporting both **HTTP** and **HTTPS** contexts.\n\n## Key Features\n\n- **Works seamlessly on both HTTP and HTTPS:**  \n  Supports the modern, secure Clipboard API (`navigator.clipboard.writeText`) used in HTTPS environments,  \n  and falls back to the legacy `document.execCommand('copy')` method for HTTP or older browsers.\n\n- **No dependency on UI elements:**  \n  Clipboard copy commands can be triggered programmatically anywhere in your Streamlit app  \n  without requiring explicit user interaction with buttons, making integration flexible and convenient.\n\n## Why Use This Package?\n\nStreamlit apps run inside iframes and are often served over HTTPS, which imposes strict browser security policies on clipboard access.  \nThis package provides a reliable way to copy text to the clipboard regardless of the protocol or browser limitations by using both secure and fallback methods.\n\n## Installation\n\n```bash\npip install st-clipboard\n```\n\n## Usage Example\nHere is an example Streamlit app showing two columns with text inputs and buttons — one using the secure clipboard copy (for HTTPS), and the other using the unsecured fallback (for HTTP):\n\n```python\nimport streamlit as st\n\nfrom st_clipboard import copy_to_clipboard, copy_to_clipboard_unsecured\n\n\n# Create two columns: HTTPS (left), HTTP (right)\ncol_https, col_http = st.columns(2)\n\nwith col_https:\n    st.markdown(\"### HTTPS Clipboard Copy\")\n    https_text = st.text_input(\"Enter text to copy (HTTPS):\", value=\"Hello HTTPS\")\n    if st.button(\"Copy to clipboard (HTTPS)\"):\n        copy_to_clipboard(https_text)\n        st.success(\"Copied to clipboard using secure method!\")\n\nwith col_http:\n    st.markdown(\"### HTTP Clipboard Copy\")\n    http_text = st.text_input(\"Enter text to copy (HTTP):\", value=\"Hello HTTP\")\n    if st.button(\"Copy to clipboard (HTTP)\"):\n        copy_to_clipboard_unsecured(http_text)\n        st.success(\"Copied to clipboard using unsecured method!\")\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaloroute%2Fst-clipboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaloroute%2Fst-clipboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaloroute%2Fst-clipboard/lists"}