winipyside 2.1.49__tar.gz
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.
- winipyside-2.1.49/LICENSE +21 -0
- winipyside-2.1.49/PKG-INFO +308 -0
- winipyside-2.1.49/README.md +284 -0
- winipyside-2.1.49/pyproject.toml +115 -0
- winipyside-2.1.49/winipyside/__init__.py +1 -0
- winipyside-2.1.49/winipyside/dev/__init__.py +1 -0
- winipyside-2.1.49/winipyside/dev/builders/__init__.py +1 -0
- winipyside-2.1.49/winipyside/dev/cli/__init__.py +1 -0
- winipyside-2.1.49/winipyside/dev/cli/shared_subcommands.py +8 -0
- winipyside-2.1.49/winipyside/dev/cli/subcommands.py +6 -0
- winipyside-2.1.49/winipyside/dev/configs/__init__.py +1 -0
- winipyside-2.1.49/winipyside/dev/configs/configs.py +125 -0
- winipyside-2.1.49/winipyside/dev/tests/__init__.py +1 -0
- winipyside-2.1.49/winipyside/dev/tests/fixtures/__init__.py +1 -0
- winipyside-2.1.49/winipyside/main.py +9 -0
- winipyside-2.1.49/winipyside/py.typed +0 -0
- winipyside-2.1.49/winipyside/resources/__init__.py +1 -0
- winipyside-2.1.49/winipyside/resources/delete_garbage_can.svg +2 -0
- winipyside-2.1.49/winipyside/resources/download_arrow.svg +3 -0
- winipyside-2.1.49/winipyside/resources/exit_fullscreen_icon.svg +7 -0
- winipyside-2.1.49/winipyside/resources/fullscreen_icon.svg +4 -0
- winipyside-2.1.49/winipyside/resources/menu_icon.svg +4 -0
- winipyside-2.1.49/winipyside/resources/pause_icon.svg +4 -0
- winipyside-2.1.49/winipyside/resources/play_icon.svg +17 -0
- winipyside-2.1.49/winipyside/resources/plus_icon.svg +24 -0
- winipyside-2.1.49/winipyside/src/__init__.py +3 -0
- winipyside-2.1.49/winipyside/src/core/__init__.py +1 -0
- winipyside-2.1.49/winipyside/src/core/py_qiodevice.py +566 -0
- winipyside-2.1.49/winipyside/src/ui/__init__.py +1 -0
- winipyside-2.1.49/winipyside/src/ui/base/__init__.py +1 -0
- winipyside-2.1.49/winipyside/src/ui/base/base.py +262 -0
- winipyside-2.1.49/winipyside/src/ui/pages/__init__.py +1 -0
- winipyside-2.1.49/winipyside/src/ui/pages/base/__init__.py +1 -0
- winipyside-2.1.49/winipyside/src/ui/pages/base/base.py +125 -0
- winipyside-2.1.49/winipyside/src/ui/pages/browser.py +37 -0
- winipyside-2.1.49/winipyside/src/ui/pages/player.py +106 -0
- winipyside-2.1.49/winipyside/src/ui/widgets/__init__.py +1 -0
- winipyside-2.1.49/winipyside/src/ui/widgets/browser.py +305 -0
- winipyside-2.1.49/winipyside/src/ui/widgets/clickable_widget.py +66 -0
- winipyside-2.1.49/winipyside/src/ui/widgets/media_player.py +489 -0
- winipyside-2.1.49/winipyside/src/ui/widgets/notification.py +100 -0
- winipyside-2.1.49/winipyside/src/ui/windows/__init__.py +1 -0
- winipyside-2.1.49/winipyside/src/ui/windows/base/__init__.py +1 -0
- winipyside-2.1.49/winipyside/src/ui/windows/base/base.py +89 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Winipedia
|
|
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.
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: winipyside
|
|
3
|
+
Version: 2.1.49
|
|
4
|
+
Summary: A utilities package for PySide6
|
|
5
|
+
Keywords:
|
|
6
|
+
Author: Winipedia
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Typing :: Typed
|
|
13
|
+
Requires-Dist: pyqt-toast-notification
|
|
14
|
+
Requires-Dist: pyside6
|
|
15
|
+
Requires-Dist: winiutils
|
|
16
|
+
Maintainer: Winipedia
|
|
17
|
+
Requires-Python: >=3.12, <3.14
|
|
18
|
+
Project-URL: Changelog, https://github.com/Winipedia/winipyside/releases
|
|
19
|
+
Project-URL: Documentation, https://Winipedia.github.io/winipyside
|
|
20
|
+
Project-URL: Homepage, https://github.com/Winipedia/winipyside
|
|
21
|
+
Project-URL: Issues, https://github.com/Winipedia/winipyside/issues
|
|
22
|
+
Project-URL: Source, https://github.com/Winipedia/winipyside
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# winipyside
|
|
26
|
+
|
|
27
|
+
<!-- tooling -->
|
|
28
|
+
[](https://github.com/Winipedia/pyrig)
|
|
29
|
+
[](https://github.com/astral-sh/uv)
|
|
30
|
+
[](https://podman.io/)
|
|
31
|
+
[](https://pre-commit.com/)
|
|
32
|
+
[](https://www.mkdocs.org/)
|
|
33
|
+
<!-- code-quality -->
|
|
34
|
+
[](https://github.com/astral-sh/ruff)
|
|
35
|
+
[](https://github.com/astral-sh/ty)
|
|
36
|
+
[](https://github.com/PyCQA/bandit)
|
|
37
|
+
[](https://pytest.org/)
|
|
38
|
+
[](https://codecov.io/gh/Winipedia/winipyside)
|
|
39
|
+
[](https://github.com/rvben/rumdl)
|
|
40
|
+
<!-- package-info -->
|
|
41
|
+
[](https://pypi.org/project/winipyside)
|
|
42
|
+
[](https://www.python.org/)
|
|
43
|
+
[](https://github.com/Winipedia/winipyside/blob/main/LICENSE)
|
|
44
|
+
<!-- ci/cd -->
|
|
45
|
+
[](https://github.com/Winipedia/winipyside/actions/workflows/health_check.yaml)
|
|
46
|
+
[](https://github.com/Winipedia/winipyside/actions/workflows/release.yaml)
|
|
47
|
+
<!-- documentation -->
|
|
48
|
+
[](https://Winipedia.github.io/winipyside)
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
> A utilities package for PySide6
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Overview
|
|
57
|
+
|
|
58
|
+
Winipyside is a production-ready PySide6 utilities package that provides
|
|
59
|
+
reusable, well-tested components for building Qt desktop applications. It
|
|
60
|
+
features encrypted file I/O with AES-GCM, a full-featured media player with
|
|
61
|
+
encrypted video playback support, an embedded web browser with cookie
|
|
62
|
+
management, toast notifications, and a modular page-based UI framework.
|
|
63
|
+
|
|
64
|
+
### Key Highlights
|
|
65
|
+
|
|
66
|
+
- 🔐 **Encrypted File I/O**:
|
|
67
|
+
Transparent AES-GCM encryption for files and media playback
|
|
68
|
+
- 🎬 **Media Player**:
|
|
69
|
+
Full-featured player with encrypted video support, speed control,
|
|
70
|
+
and fullscreen mode
|
|
71
|
+
- 🌐 **Web Browser**:
|
|
72
|
+
Embedded browser with cookie management and Qt/Python cookie conversion
|
|
73
|
+
- 🔔 **Notifications**:
|
|
74
|
+
Toast notification system with auto-positioning and smart text truncation
|
|
75
|
+
- 🏗️ **UI Framework**:
|
|
76
|
+
Modular page-based architecture with lifecycle hooks and navigation
|
|
77
|
+
- ✅ **Type Safe**: 100% type annotated with strict mypy checking
|
|
78
|
+
- 🧪 **Well Tested**: Comprehensive test suite with pytest and pytest-qt
|
|
79
|
+
- 🚀 **CI/CD Ready**: Production-ready workflows for headless environments
|
|
80
|
+
|
|
81
|
+
## Features
|
|
82
|
+
|
|
83
|
+
### 🔐 Encrypted File I/O
|
|
84
|
+
|
|
85
|
+
Transparent encryption/decryption for files and media with AES-GCM:
|
|
86
|
+
|
|
87
|
+
- **Chunked encryption** for efficient streaming (64KB chunks)
|
|
88
|
+
- **Random access** support with position mapping
|
|
89
|
+
- **Zero-copy decryption** for media playback
|
|
90
|
+
- **Authenticated encryption** with nonces and tags
|
|
91
|
+
|
|
92
|
+
### 🎬 Media Player
|
|
93
|
+
|
|
94
|
+
Full-featured video player with advanced controls:
|
|
95
|
+
|
|
96
|
+
- Play/pause, speed control (0.2x-5x), volume slider
|
|
97
|
+
- Seekable progress bar with throttled updates
|
|
98
|
+
- Fullscreen mode with automatic UI hiding
|
|
99
|
+
- **Native encrypted video playback** without temporary files
|
|
100
|
+
- Position resumption and smart resource management
|
|
101
|
+
|
|
102
|
+
### 🌐 Web Browser
|
|
103
|
+
|
|
104
|
+
Embedded Chromium-based browser:
|
|
105
|
+
|
|
106
|
+
- Navigation controls (back, forward, address bar)
|
|
107
|
+
- Automatic cookie tracking
|
|
108
|
+
- QNetworkCookie ↔ http.cookiejar.Cookie conversion
|
|
109
|
+
- Domain-based cookie retrieval
|
|
110
|
+
|
|
111
|
+
### 🏗️ UI Framework
|
|
112
|
+
|
|
113
|
+
Modular architecture for building complex applications:
|
|
114
|
+
|
|
115
|
+
- **Lifecycle hooks**:
|
|
116
|
+
`base_setup()` → `pre_setup()` → `setup()` → `post_setup()`
|
|
117
|
+
- **Page-based navigation** with QStackedWidget
|
|
118
|
+
- **Dynamic subclass discovery**
|
|
119
|
+
- **SVG icon support**
|
|
120
|
+
- **Automatic display name generation**
|
|
121
|
+
|
|
122
|
+
## Installation
|
|
123
|
+
|
|
124
|
+
### Requirements
|
|
125
|
+
|
|
126
|
+
- Python 3.12 or 3.13
|
|
127
|
+
- PySide6
|
|
128
|
+
- System dependencies (Linux only):
|
|
129
|
+
- `libegl1`
|
|
130
|
+
- `libpulse0`
|
|
131
|
+
|
|
132
|
+
### Install from PyPI
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
pip install winipyside
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Install from Source
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
git clone https://github.com/Winipedia/winipyside.git
|
|
142
|
+
cd winipyside
|
|
143
|
+
uv sync
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Linux System Dependencies
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
sudo apt-get update
|
|
150
|
+
sudo apt-get install -y libegl1 libpulse0
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Quick Start
|
|
154
|
+
|
|
155
|
+
### Basic Application
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
from PySide6.QtWidgets import QApplication
|
|
159
|
+
from winipyside.src.ui.windows.base.base import Base as BaseWindow
|
|
160
|
+
from winipyside.src.ui.pages.browser import Browser
|
|
161
|
+
|
|
162
|
+
class MyApp(BaseWindow):
|
|
163
|
+
@classmethod
|
|
164
|
+
def get_all_page_classes(cls):
|
|
165
|
+
return [Browser]
|
|
166
|
+
|
|
167
|
+
@classmethod
|
|
168
|
+
def get_start_page_cls(cls):
|
|
169
|
+
return Browser
|
|
170
|
+
|
|
171
|
+
def pre_setup(self) -> None:
|
|
172
|
+
pass
|
|
173
|
+
|
|
174
|
+
def setup(self) -> None:
|
|
175
|
+
self.resize(1280, 720)
|
|
176
|
+
|
|
177
|
+
def post_setup(self) -> None:
|
|
178
|
+
pass
|
|
179
|
+
|
|
180
|
+
if __name__ == "__main__":
|
|
181
|
+
app = QApplication([])
|
|
182
|
+
window = MyApp()
|
|
183
|
+
window.show()
|
|
184
|
+
app.exec()
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Encrypted Video Playback
|
|
188
|
+
|
|
189
|
+
```python
|
|
190
|
+
from pathlib import Path
|
|
191
|
+
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
|
|
192
|
+
from PySide6.QtCore import QUrl, QIODevice
|
|
193
|
+
from PySide6.QtMultimedia import QMediaPlayer, QAudioOutput
|
|
194
|
+
from winipyside.src.core.py_qiodevice import EncryptedPyQFile
|
|
195
|
+
|
|
196
|
+
# Generate encryption key
|
|
197
|
+
key = AESGCM.generate_key(bit_length=256)
|
|
198
|
+
aes_gcm = AESGCM(key)
|
|
199
|
+
|
|
200
|
+
# Play encrypted video
|
|
201
|
+
video_path = Path("encrypted_video.mp4")
|
|
202
|
+
encrypted_file = EncryptedPyQFile(video_path, aes_gcm)
|
|
203
|
+
encrypted_file.open(QIODevice.OpenModeFlag.ReadOnly)
|
|
204
|
+
|
|
205
|
+
player = QMediaPlayer()
|
|
206
|
+
player.setAudioOutput(QAudioOutput())
|
|
207
|
+
player.setSourceDevice(encrypted_file, QUrl.fromLocalFile(str(video_path)))
|
|
208
|
+
player.play()
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Toast Notifications
|
|
212
|
+
|
|
213
|
+
```python
|
|
214
|
+
from winipyside.src.ui.widgets.notification import Notification
|
|
215
|
+
from pyqttoast import ToastIcon
|
|
216
|
+
|
|
217
|
+
Notification(
|
|
218
|
+
title="Success",
|
|
219
|
+
text="Operation completed successfully!",
|
|
220
|
+
icon=ToastIcon.SUCCESS,
|
|
221
|
+
duration=5000
|
|
222
|
+
)
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## Documentation
|
|
226
|
+
|
|
227
|
+
Comprehensive documentation is available in the [`docs/`](docs/) directory:
|
|
228
|
+
|
|
229
|
+
- **[Core Package](docs/core.md)** - Encrypted file I/O and QIODevice wrappers
|
|
230
|
+
- **[UI Base](docs/ui-base.md)** - Foundation framework and lifecycle management
|
|
231
|
+
- **[UI Widgets](docs/ui-widgets.md)** - Reusable widgets (Browser, MediaPlayer, Notifications)
|
|
232
|
+
- **[UI Pages](docs/ui-pages.md)** - Page components for navigation
|
|
233
|
+
- **[UI Windows](docs/ui-windows.md)** - Main window framework
|
|
234
|
+
- **[API Reference](docs/api-reference.md)** - Complete API documentation
|
|
235
|
+
|
|
236
|
+
## Architecture
|
|
237
|
+
|
|
238
|
+
```text
|
|
239
|
+
winipyside/
|
|
240
|
+
├── src/
|
|
241
|
+
│ ├── core/ # Encrypted file I/O
|
|
242
|
+
│ └── ui/
|
|
243
|
+
│ ├── base/ # Base classes and lifecycle
|
|
244
|
+
│ ├── widgets/ # Reusable widgets
|
|
245
|
+
│ ├── pages/ # Page components
|
|
246
|
+
│ └── windows/ # Window framework
|
|
247
|
+
├── resources/ # SVG icons and static resources
|
|
248
|
+
└── dev/
|
|
249
|
+
├── builders/ # Build utilities
|
|
250
|
+
├── cli/ # CLI commands
|
|
251
|
+
├── configs/ # CI/CD configuration
|
|
252
|
+
└── tests/ # Test fixtures
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## Development
|
|
256
|
+
|
|
257
|
+
### Setup Development Environment
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# Clone the repository
|
|
261
|
+
git clone https://github.com/Winipedia/winipyside.git
|
|
262
|
+
cd winipyside
|
|
263
|
+
|
|
264
|
+
# Install dependencies with uv
|
|
265
|
+
uv sync
|
|
266
|
+
|
|
267
|
+
# Install pre-commit hooks
|
|
268
|
+
uv run pre-commit install
|
|
269
|
+
|
|
270
|
+
# get familiar with pyrig
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Contributing
|
|
274
|
+
|
|
275
|
+
Contributions are welcome! Please follow these guidelines:
|
|
276
|
+
|
|
277
|
+
1. **Fork the repository** and create a feature branch
|
|
278
|
+
2. **Write tests** for new functionality
|
|
279
|
+
3. **Ensure all tests pass** and code quality checks succeed
|
|
280
|
+
4. **Update documentation** as needed
|
|
281
|
+
5. **Submit a pull request** with a clear description
|
|
282
|
+
|
|
283
|
+
### Code Standards
|
|
284
|
+
|
|
285
|
+
- Follow **Google docstring convention**
|
|
286
|
+
- Maintain **100% type coverage**
|
|
287
|
+
- Write **comprehensive tests** (aim for >90% coverage)
|
|
288
|
+
- Use **descriptive variable names**
|
|
289
|
+
- Keep functions **focused and small**
|
|
290
|
+
|
|
291
|
+
## License
|
|
292
|
+
|
|
293
|
+
This project is licensed under the MIT License,
|
|
294
|
+
see the [LICENSE](LICENSE) file for details.
|
|
295
|
+
|
|
296
|
+
## Acknowledgments
|
|
297
|
+
|
|
298
|
+
- Built with [Pyrig](https://github.com/Winipedia/pyrig) - Python project scaffolding framework
|
|
299
|
+
- Uses [PySide6](https://www.qt.io/qt-for-python) - Qt for Python
|
|
300
|
+
- Toast notifications powered by [pyqttoast](https://github.com/niklashenning/pyqttoast)
|
|
301
|
+
|
|
302
|
+
## Support
|
|
303
|
+
|
|
304
|
+
- **Documentation**: [docs/](docs/)
|
|
305
|
+
- **Issues**: [GitHub Issues](https://github.com/Winipedia/winipyside/issues)
|
|
306
|
+
- **Discussions**: [GitHub Discussions](https://github.com/Winipedia/winipyside/discussions)
|
|
307
|
+
|
|
308
|
+
---
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
# winipyside
|
|
2
|
+
|
|
3
|
+
<!-- tooling -->
|
|
4
|
+
[](https://github.com/Winipedia/pyrig)
|
|
5
|
+
[](https://github.com/astral-sh/uv)
|
|
6
|
+
[](https://podman.io/)
|
|
7
|
+
[](https://pre-commit.com/)
|
|
8
|
+
[](https://www.mkdocs.org/)
|
|
9
|
+
<!-- code-quality -->
|
|
10
|
+
[](https://github.com/astral-sh/ruff)
|
|
11
|
+
[](https://github.com/astral-sh/ty)
|
|
12
|
+
[](https://github.com/PyCQA/bandit)
|
|
13
|
+
[](https://pytest.org/)
|
|
14
|
+
[](https://codecov.io/gh/Winipedia/winipyside)
|
|
15
|
+
[](https://github.com/rvben/rumdl)
|
|
16
|
+
<!-- package-info -->
|
|
17
|
+
[](https://pypi.org/project/winipyside)
|
|
18
|
+
[](https://www.python.org/)
|
|
19
|
+
[](https://github.com/Winipedia/winipyside/blob/main/LICENSE)
|
|
20
|
+
<!-- ci/cd -->
|
|
21
|
+
[](https://github.com/Winipedia/winipyside/actions/workflows/health_check.yaml)
|
|
22
|
+
[](https://github.com/Winipedia/winipyside/actions/workflows/release.yaml)
|
|
23
|
+
<!-- documentation -->
|
|
24
|
+
[](https://Winipedia.github.io/winipyside)
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
> A utilities package for PySide6
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Overview
|
|
33
|
+
|
|
34
|
+
Winipyside is a production-ready PySide6 utilities package that provides
|
|
35
|
+
reusable, well-tested components for building Qt desktop applications. It
|
|
36
|
+
features encrypted file I/O with AES-GCM, a full-featured media player with
|
|
37
|
+
encrypted video playback support, an embedded web browser with cookie
|
|
38
|
+
management, toast notifications, and a modular page-based UI framework.
|
|
39
|
+
|
|
40
|
+
### Key Highlights
|
|
41
|
+
|
|
42
|
+
- 🔐 **Encrypted File I/O**:
|
|
43
|
+
Transparent AES-GCM encryption for files and media playback
|
|
44
|
+
- 🎬 **Media Player**:
|
|
45
|
+
Full-featured player with encrypted video support, speed control,
|
|
46
|
+
and fullscreen mode
|
|
47
|
+
- 🌐 **Web Browser**:
|
|
48
|
+
Embedded browser with cookie management and Qt/Python cookie conversion
|
|
49
|
+
- 🔔 **Notifications**:
|
|
50
|
+
Toast notification system with auto-positioning and smart text truncation
|
|
51
|
+
- 🏗️ **UI Framework**:
|
|
52
|
+
Modular page-based architecture with lifecycle hooks and navigation
|
|
53
|
+
- ✅ **Type Safe**: 100% type annotated with strict mypy checking
|
|
54
|
+
- 🧪 **Well Tested**: Comprehensive test suite with pytest and pytest-qt
|
|
55
|
+
- 🚀 **CI/CD Ready**: Production-ready workflows for headless environments
|
|
56
|
+
|
|
57
|
+
## Features
|
|
58
|
+
|
|
59
|
+
### 🔐 Encrypted File I/O
|
|
60
|
+
|
|
61
|
+
Transparent encryption/decryption for files and media with AES-GCM:
|
|
62
|
+
|
|
63
|
+
- **Chunked encryption** for efficient streaming (64KB chunks)
|
|
64
|
+
- **Random access** support with position mapping
|
|
65
|
+
- **Zero-copy decryption** for media playback
|
|
66
|
+
- **Authenticated encryption** with nonces and tags
|
|
67
|
+
|
|
68
|
+
### 🎬 Media Player
|
|
69
|
+
|
|
70
|
+
Full-featured video player with advanced controls:
|
|
71
|
+
|
|
72
|
+
- Play/pause, speed control (0.2x-5x), volume slider
|
|
73
|
+
- Seekable progress bar with throttled updates
|
|
74
|
+
- Fullscreen mode with automatic UI hiding
|
|
75
|
+
- **Native encrypted video playback** without temporary files
|
|
76
|
+
- Position resumption and smart resource management
|
|
77
|
+
|
|
78
|
+
### 🌐 Web Browser
|
|
79
|
+
|
|
80
|
+
Embedded Chromium-based browser:
|
|
81
|
+
|
|
82
|
+
- Navigation controls (back, forward, address bar)
|
|
83
|
+
- Automatic cookie tracking
|
|
84
|
+
- QNetworkCookie ↔ http.cookiejar.Cookie conversion
|
|
85
|
+
- Domain-based cookie retrieval
|
|
86
|
+
|
|
87
|
+
### 🏗️ UI Framework
|
|
88
|
+
|
|
89
|
+
Modular architecture for building complex applications:
|
|
90
|
+
|
|
91
|
+
- **Lifecycle hooks**:
|
|
92
|
+
`base_setup()` → `pre_setup()` → `setup()` → `post_setup()`
|
|
93
|
+
- **Page-based navigation** with QStackedWidget
|
|
94
|
+
- **Dynamic subclass discovery**
|
|
95
|
+
- **SVG icon support**
|
|
96
|
+
- **Automatic display name generation**
|
|
97
|
+
|
|
98
|
+
## Installation
|
|
99
|
+
|
|
100
|
+
### Requirements
|
|
101
|
+
|
|
102
|
+
- Python 3.12 or 3.13
|
|
103
|
+
- PySide6
|
|
104
|
+
- System dependencies (Linux only):
|
|
105
|
+
- `libegl1`
|
|
106
|
+
- `libpulse0`
|
|
107
|
+
|
|
108
|
+
### Install from PyPI
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
pip install winipyside
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Install from Source
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
git clone https://github.com/Winipedia/winipyside.git
|
|
118
|
+
cd winipyside
|
|
119
|
+
uv sync
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Linux System Dependencies
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
sudo apt-get update
|
|
126
|
+
sudo apt-get install -y libegl1 libpulse0
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Quick Start
|
|
130
|
+
|
|
131
|
+
### Basic Application
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
from PySide6.QtWidgets import QApplication
|
|
135
|
+
from winipyside.src.ui.windows.base.base import Base as BaseWindow
|
|
136
|
+
from winipyside.src.ui.pages.browser import Browser
|
|
137
|
+
|
|
138
|
+
class MyApp(BaseWindow):
|
|
139
|
+
@classmethod
|
|
140
|
+
def get_all_page_classes(cls):
|
|
141
|
+
return [Browser]
|
|
142
|
+
|
|
143
|
+
@classmethod
|
|
144
|
+
def get_start_page_cls(cls):
|
|
145
|
+
return Browser
|
|
146
|
+
|
|
147
|
+
def pre_setup(self) -> None:
|
|
148
|
+
pass
|
|
149
|
+
|
|
150
|
+
def setup(self) -> None:
|
|
151
|
+
self.resize(1280, 720)
|
|
152
|
+
|
|
153
|
+
def post_setup(self) -> None:
|
|
154
|
+
pass
|
|
155
|
+
|
|
156
|
+
if __name__ == "__main__":
|
|
157
|
+
app = QApplication([])
|
|
158
|
+
window = MyApp()
|
|
159
|
+
window.show()
|
|
160
|
+
app.exec()
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Encrypted Video Playback
|
|
164
|
+
|
|
165
|
+
```python
|
|
166
|
+
from pathlib import Path
|
|
167
|
+
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
|
|
168
|
+
from PySide6.QtCore import QUrl, QIODevice
|
|
169
|
+
from PySide6.QtMultimedia import QMediaPlayer, QAudioOutput
|
|
170
|
+
from winipyside.src.core.py_qiodevice import EncryptedPyQFile
|
|
171
|
+
|
|
172
|
+
# Generate encryption key
|
|
173
|
+
key = AESGCM.generate_key(bit_length=256)
|
|
174
|
+
aes_gcm = AESGCM(key)
|
|
175
|
+
|
|
176
|
+
# Play encrypted video
|
|
177
|
+
video_path = Path("encrypted_video.mp4")
|
|
178
|
+
encrypted_file = EncryptedPyQFile(video_path, aes_gcm)
|
|
179
|
+
encrypted_file.open(QIODevice.OpenModeFlag.ReadOnly)
|
|
180
|
+
|
|
181
|
+
player = QMediaPlayer()
|
|
182
|
+
player.setAudioOutput(QAudioOutput())
|
|
183
|
+
player.setSourceDevice(encrypted_file, QUrl.fromLocalFile(str(video_path)))
|
|
184
|
+
player.play()
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Toast Notifications
|
|
188
|
+
|
|
189
|
+
```python
|
|
190
|
+
from winipyside.src.ui.widgets.notification import Notification
|
|
191
|
+
from pyqttoast import ToastIcon
|
|
192
|
+
|
|
193
|
+
Notification(
|
|
194
|
+
title="Success",
|
|
195
|
+
text="Operation completed successfully!",
|
|
196
|
+
icon=ToastIcon.SUCCESS,
|
|
197
|
+
duration=5000
|
|
198
|
+
)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Documentation
|
|
202
|
+
|
|
203
|
+
Comprehensive documentation is available in the [`docs/`](docs/) directory:
|
|
204
|
+
|
|
205
|
+
- **[Core Package](docs/core.md)** - Encrypted file I/O and QIODevice wrappers
|
|
206
|
+
- **[UI Base](docs/ui-base.md)** - Foundation framework and lifecycle management
|
|
207
|
+
- **[UI Widgets](docs/ui-widgets.md)** - Reusable widgets (Browser, MediaPlayer, Notifications)
|
|
208
|
+
- **[UI Pages](docs/ui-pages.md)** - Page components for navigation
|
|
209
|
+
- **[UI Windows](docs/ui-windows.md)** - Main window framework
|
|
210
|
+
- **[API Reference](docs/api-reference.md)** - Complete API documentation
|
|
211
|
+
|
|
212
|
+
## Architecture
|
|
213
|
+
|
|
214
|
+
```text
|
|
215
|
+
winipyside/
|
|
216
|
+
├── src/
|
|
217
|
+
│ ├── core/ # Encrypted file I/O
|
|
218
|
+
│ └── ui/
|
|
219
|
+
│ ├── base/ # Base classes and lifecycle
|
|
220
|
+
│ ├── widgets/ # Reusable widgets
|
|
221
|
+
│ ├── pages/ # Page components
|
|
222
|
+
│ └── windows/ # Window framework
|
|
223
|
+
├── resources/ # SVG icons and static resources
|
|
224
|
+
└── dev/
|
|
225
|
+
├── builders/ # Build utilities
|
|
226
|
+
├── cli/ # CLI commands
|
|
227
|
+
├── configs/ # CI/CD configuration
|
|
228
|
+
└── tests/ # Test fixtures
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Development
|
|
232
|
+
|
|
233
|
+
### Setup Development Environment
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
# Clone the repository
|
|
237
|
+
git clone https://github.com/Winipedia/winipyside.git
|
|
238
|
+
cd winipyside
|
|
239
|
+
|
|
240
|
+
# Install dependencies with uv
|
|
241
|
+
uv sync
|
|
242
|
+
|
|
243
|
+
# Install pre-commit hooks
|
|
244
|
+
uv run pre-commit install
|
|
245
|
+
|
|
246
|
+
# get familiar with pyrig
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Contributing
|
|
250
|
+
|
|
251
|
+
Contributions are welcome! Please follow these guidelines:
|
|
252
|
+
|
|
253
|
+
1. **Fork the repository** and create a feature branch
|
|
254
|
+
2. **Write tests** for new functionality
|
|
255
|
+
3. **Ensure all tests pass** and code quality checks succeed
|
|
256
|
+
4. **Update documentation** as needed
|
|
257
|
+
5. **Submit a pull request** with a clear description
|
|
258
|
+
|
|
259
|
+
### Code Standards
|
|
260
|
+
|
|
261
|
+
- Follow **Google docstring convention**
|
|
262
|
+
- Maintain **100% type coverage**
|
|
263
|
+
- Write **comprehensive tests** (aim for >90% coverage)
|
|
264
|
+
- Use **descriptive variable names**
|
|
265
|
+
- Keep functions **focused and small**
|
|
266
|
+
|
|
267
|
+
## License
|
|
268
|
+
|
|
269
|
+
This project is licensed under the MIT License,
|
|
270
|
+
see the [LICENSE](LICENSE) file for details.
|
|
271
|
+
|
|
272
|
+
## Acknowledgments
|
|
273
|
+
|
|
274
|
+
- Built with [Pyrig](https://github.com/Winipedia/pyrig) - Python project scaffolding framework
|
|
275
|
+
- Uses [PySide6](https://www.qt.io/qt-for-python) - Qt for Python
|
|
276
|
+
- Toast notifications powered by [pyqttoast](https://github.com/niklashenning/pyqttoast)
|
|
277
|
+
|
|
278
|
+
## Support
|
|
279
|
+
|
|
280
|
+
- **Documentation**: [docs/](docs/)
|
|
281
|
+
- **Issues**: [GitHub Issues](https://github.com/Winipedia/winipyside/issues)
|
|
282
|
+
- **Discussions**: [GitHub Discussions](https://github.com/Winipedia/winipyside/discussions)
|
|
283
|
+
|
|
284
|
+
---
|