st-copy 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,73 @@
1
+ Metadata-Version: 2.4
2
+ Name: st-copy
3
+ Version: 0.1.0
4
+ Summary: Streamlit copy‑to‑clipboard button component
5
+ Author-email: Aleksandr Filippov <alex-feel.saga628@passmail.com>
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.9
8
+ Requires-Dist: streamlit>=0.79.0
9
+ Description-Content-Type: text/markdown
10
+
11
+ # Streamlit Copy-to-Clipboard Button Component
12
+
13
+ [![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_red.svg)](https://st-copy.streamlit.app/) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) [![Python Version](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Falex-feel%2Fst-copy%2Frefs%2Fheads%2Fmain%2Fpyproject.toml)](https://github.com/alex-feel/st-copy/blob/main/pyproject.toml) [![GitHub License](https://img.shields.io/github/license/alex-feel/st-copy)](https://github.com/alex-feel/st-copy/blob/main/LICENSE)
14
+
15
+ A **tiny, theme‑aware Streamlit component** that adds a one‑click "copy-to-clipboard" button to your app — perfect for the chat UI, URLs or any other text the user might need to copy.
16
+
17
+ ## ✨ Features
18
+ - **Streamlit theme aware**: Adapts icon colour & tooltip style automatically; works in both light _and_ dark themes.
19
+ - **Tiny, zero‑dep frontend**: A single 2-KB bundle → instant load. No extra JS libraries.
20
+ - **Two icon styles**: Google *Material Symbols* (default) or the native Streamlit code‑block icon.
21
+ - **Custom tooltip & "Copied!" label**: Localised UI in one line.
22
+ - **Keyboard‑friendly**: Fully focusable, press **Enter/Space** to copy.
23
+ - **No server round‑trip**: Uses the browser Clipboard API, returns `True/False` to Python instantly.
24
+ - **Hot‑reload during development**: Set an env‑var and work against your Vite dev‑server with no wheel rebuilds.
25
+
26
+ ## 🔧 Installation
27
+
28
+ ```bash
29
+ pip install st-copy
30
+ ````
31
+
32
+ ## ⚡ Quick start
33
+
34
+ ```python
35
+ import streamlit as st
36
+ from st_copy import copy_button
37
+
38
+ st.title('Minimal demo')
39
+
40
+ copy_button('Hello, Streamlit!') # one line – that's it 🎉
41
+ ```
42
+
43
+ Run your script:
44
+
45
+ ```
46
+ streamlit run app.py
47
+ ```
48
+
49
+ ## 🛠 API
50
+
51
+ ```python
52
+ def copy_button(
53
+ text: str,
54
+ *,
55
+ icon: Literal['material_symbols', 'st'] = 'material_symbols',
56
+ tooltip: str = 'Copy',
57
+ copied_label: str = 'Copied!',
58
+ key: Optional[str] = None,
59
+ ) -> Optional[bool]:
60
+ ```
61
+
62
+ | Parameter | Type / Default | Description |
63
+ | -------------- | ------------------------------------------------------------------- |------------------------------------------------------------------------------------------------------------------|
64
+ | `text` | **str** | Text placed on the user’s clipboard. |
65
+ | `icon` | `Literal['material_symbols', 'st']`<br>default `'material_symbols'` | Icon style: Google Material **content\_copy** (`material_symbols`) or Streamlit’s native code‑block icon (`st`). |
66
+ | `tooltip` | **str**, default `'Copy'` | Tooltip shown on hover/focus. |
67
+ | `copied_label` | **str**, default `'Copied!'` | Small label displayed for ~1 s after a successful copy. |
68
+ | `key` | **str \| None**, default `None` | Unique component key; if omitted a random UUIDv4 is generated. |
69
+ | **Returns** | **bool \| None** | `True` – copy succeeded; `False` – Clipboard API failed; `None` – button not clicked yet. |
70
+
71
+ ## 🎨 Examples
72
+
73
+ See [examples/app.py](./examples/app.py) for a chat‑style demo that showcases every argument and the deployed version at https://st-copy.streamlit.app/.
@@ -0,0 +1,4 @@
1
+ st_copy-0.1.0.dist-info/METADATA,sha256=lALe_D93Os_eSPwjKnsbFbhkmKaw8X65YCHSWYsrvOQ,4210
2
+ st_copy-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
3
+ st_copy-0.1.0.dist-info/licenses/LICENSE,sha256=lpgj4Lk1PT3rLKyAGxxEXY0kSq0BaAsCBKZZEYMAeGs,1075
4
+ st_copy-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Aleksandr Filippov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.