pyw-core 0.0.0.post1__py3-none-any.whl → 0.0.0.post3__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,393 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyw-core
3
+ Version: 0.0.0.post3
4
+ Summary: Reserved placeholder for pyw-core (umbrella namespace)
5
+ Project-URL: Homepage, https://github.com/pythonWoods/pyw-core
6
+ Project-URL: Documentation, https://pythonwoods.dev/docs/pyw-core/latest/
7
+ Project-URL: Issues, https://github.com/pythonWoods/pyw-core/issues
8
+ Project-URL: Changelog, https://github.com/pythonWoods/pyw-core/releases
9
+ Author: pythonWoods
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Classifier: Development Status :: 2 - Pre-Alpha
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Typing :: Typed
17
+ Requires-Python: >=3.9
18
+ Description-Content-Type: text/markdown
19
+
20
+ # pyw-core 🌐
21
+ [![PyPI](https://img.shields.io/pypi/v/pyw-core.svg)](https://pypi.org/project/pyw-core/)
22
+ [![CI](https://github.com/pythonWoods/pyw-core/actions/workflows/ci.yml/badge.svg)](https://github.com/pythonWoods/pyw-core/actions/workflows/ci.yml)
23
+ [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
24
+
25
+ > Namespace seed & common utilities for the **pythonWoods** ecosystem.
26
+
27
+ ## Overview
28
+
29
+ **pyw-core** è il cuore dell'ecosistema pythonWoods, fornendo il namespace condiviso, utilities comuni e le basi architetturali per tutti i moduli. Anche se minimalista per design, è il fondamento che garantisce coerenza e interoperabilità tra tutti i package.
30
+
31
+ ## Ecosystem Overview
32
+
33
+ | Package | Description | Status |
34
+ |---------|-------------|--------|
35
+ | **pyw-core** | Namespace & common utilities | `0.0.0` |
36
+ | **pyw-logger** | Structured logging (rich + structlog) | `0.0.0` |
37
+ | **pyw-fs** | Unified filesystem (local/S3/GCS) | `0.0.0` |
38
+ | **pyw-secret** | Secret backends (.env, Vault, SSM) | `0.0.0` |
39
+ | **pyw-cli** | Typer CLI scaffolding | `0.0.0` |
40
+ | **pyw-config** | Configuration utilities | `0.0.0` |
41
+ | **pyw-vision** | Vision utilities & helpers | `0.0.0` |
42
+ | **pyw-motion** | Motion detection & tracking | `0.0.0` |
43
+ | **pyw-music21** | Music21 stubs & helpers | `0.0.0` |
44
+ | **pyw-musicparser** | Parse MIDI/Lilypond | `0.0.0` |
45
+
46
+ ## Bundle Packages
47
+
48
+ | Bundle | Description | Includes |
49
+ |--------|-------------|----------|
50
+ | **pyw-devtools** | Developer toolkit | logger, fs, cli, secret, config |
51
+ | **pyw-music** | Music processing | music21, musicparser |
52
+ | **pyw-cv** | Computer vision | vision, motion |
53
+
54
+ ## Philosophy
55
+
56
+ * **Namespace package** – `import pyw.*` per evitare conflitti e garantire coerenza
57
+ * **Small, composable modules** – scegli solo ciò che ti serve, zero bloat
58
+ * **Typed APIs** – Pydantic models e type hints per zero sorprese
59
+ * **No heavy deps by default** – librerie "pesanti" (Torch, OpenCV) come extras opzionali
60
+ * **Interoperability-first** – tutti i moduli condividono pattern e utilities comuni
61
+
62
+ ## Installation
63
+
64
+ ```bash
65
+ pip install pyw-core
66
+ ```
67
+
68
+ **pyw-core** è intenzionalmente minimalista: fornisce solo il namespace e utilities fondamentali condivise dall'ecosistema.
69
+
70
+ ## Core Features
71
+
72
+ ### 🏗️ Base Classes
73
+
74
+ ```python
75
+ from pyw.core import BaseConfig, BaseModel
76
+ from pyw.core.types import PathLike, JsonDict
77
+
78
+ class MyConfig(BaseConfig):
79
+ """Configurazione con validazione type-safe."""
80
+ name: str
81
+ debug: bool = False
82
+ paths: list[PathLike] = []
83
+
84
+ class DataModel(BaseModel):
85
+ """Modello dati con serializzazione automatica."""
86
+ id: int
87
+ metadata: JsonDict = {}
88
+ ```
89
+
90
+ ### 🔧 Common Utilities
91
+
92
+ ```python
93
+ from pyw.core.utils import (
94
+ ensure_list, deep_merge, safe_import,
95
+ classproperty, deprecated
96
+ )
97
+
98
+ # List normalization
99
+ items = ensure_list("single_item") # → ["single_item"]
100
+ items = ensure_list(["already", "list"]) # → ["already", "list"]
101
+
102
+ # Deep dictionary merging
103
+ config = deep_merge(
104
+ {"db": {"host": "localhost", "port": 5432}},
105
+ {"db": {"port": 3306, "ssl": True}}
106
+ )
107
+ # → {"db": {"host": "localhost", "port": 3306, "ssl": True}}
108
+
109
+ # Safe imports con fallback
110
+ requests = safe_import("requests", fallback_message="pip install requests")
111
+
112
+ # Class properties
113
+ class MyClass:
114
+ @classproperty
115
+ def version(cls):
116
+ return "1.0.0"
117
+
118
+ # Deprecation warnings
119
+ @deprecated("Use new_function() instead", version="2.0.0")
120
+ def old_function():
121
+ pass
122
+ ```
123
+
124
+ ### 📦 Plugin Discovery
125
+
126
+ ```python
127
+ from pyw.core.plugins import discover_plugins, load_plugin
128
+
129
+ # Trova tutti i plugin pyw installati
130
+ plugins = discover_plugins("pyw.*")
131
+
132
+ # Carica plugin specifico
133
+ logger_plugin = load_plugin("pyw.logger")
134
+ ```
135
+
136
+ ### 🔍 Type Utilities
137
+
138
+ ```python
139
+ from pyw.core.types import (
140
+ PathLike, JsonDict, OptionalStr,
141
+ Singleton, classproperty
142
+ )
143
+ from typing import Any
144
+
145
+ # Type aliases comuni
146
+ def process_file(path: PathLike) -> JsonDict:
147
+ """Accetta str, Path, o file-like objects."""
148
+ pass
149
+
150
+ # Singleton pattern
151
+ class DatabaseConnection(Singleton):
152
+ def __init__(self):
153
+ self.connected = False
154
+
155
+ # Sempre la stessa istanza
156
+ db1 = DatabaseConnection()
157
+ db2 = DatabaseConnection()
158
+ assert db1 is db2
159
+ ```
160
+
161
+ ### ⚡ Performance Utilities
162
+
163
+ ```python
164
+ from pyw.core.performance import (
165
+ timer, cache_result, rate_limit,
166
+ memory_usage
167
+ )
168
+ import time
169
+
170
+ # Timing decorator
171
+ @timer
172
+ def slow_function():
173
+ time.sleep(1)
174
+ return "done"
175
+
176
+ result = slow_function() # Logs: "slow_function took 1.002s"
177
+
178
+ # Result caching
179
+ @cache_result(ttl=300) # Cache for 5 minutes
180
+ def expensive_computation(x: int) -> int:
181
+ return x ** 2
182
+
183
+ # Rate limiting
184
+ @rate_limit(calls=10, period=60) # Max 10 calls/minute
185
+ def api_call():
186
+ pass
187
+
188
+ # Memory monitoring
189
+ with memory_usage() as mem:
190
+ big_list = list(range(1000000))
191
+ print(f"Memory used: {mem.peak_mb:.1f} MB")
192
+ ```
193
+
194
+ ## Integration Patterns
195
+
196
+ ### 🔗 Module Integration
197
+
198
+ ```python
199
+ # Pattern per moduli pyw
200
+ from pyw.core import BaseModule
201
+
202
+ class MyModule(BaseModule):
203
+ """Template per nuovi moduli pyw."""
204
+
205
+ name = "my-module"
206
+ version = "1.0.0"
207
+ dependencies = ["pyw-core>=0.1.0"]
208
+
209
+ def __init__(self, config=None):
210
+ super().__init__()
211
+ self.config = config or self.default_config()
212
+
213
+ @classmethod
214
+ def default_config(cls):
215
+ return {"enabled": True}
216
+ ```
217
+
218
+ ### 🧪 Testing Support
219
+
220
+ ```python
221
+ from pyw.core.testing import (
222
+ temporary_directory, mock_environment,
223
+ assert_type_safe, benchmark
224
+ )
225
+
226
+ def test_my_function():
227
+ with temporary_directory() as tmpdir:
228
+ # Test con directory temporanea
229
+ pass
230
+
231
+ with mock_environment({"DEBUG": "true"}):
232
+ # Test con environment variables mock
233
+ pass
234
+
235
+ # Type safety testing
236
+ result = my_typed_function("input")
237
+ assert_type_safe(result, MyExpectedType)
238
+
239
+ # Performance benchmarking
240
+ with benchmark("my_operation") as b:
241
+ expensive_operation()
242
+ assert b.elapsed < 1.0 # Max 1 second
243
+ ```
244
+
245
+ ## Bundle Installation
246
+
247
+ Per installare gruppi di moduli correlati:
248
+
249
+ ```bash
250
+ # Developer toolkit completo
251
+ pip install pyw-devtools # logger + fs + cli + secret + config
252
+
253
+ # Music processing
254
+ pip install pyw-music # music21 + musicparser
255
+
256
+ # Computer vision
257
+ pip install pyw-cv # vision + motion
258
+ ```
259
+
260
+ ## Advanced Usage
261
+
262
+ ### 🔌 Custom Extensions
263
+
264
+ ```python
265
+ from pyw.core.extensions import register_extension
266
+
267
+ @register_extension("mycompany.custom")
268
+ class CustomExtension:
269
+ """Estensione personalizzata per pyw."""
270
+
271
+ def setup(self):
272
+ # Inizializzazione custom
273
+ pass
274
+
275
+ # Auto-discovered da pyw.core.plugins
276
+ ```
277
+
278
+ ### 📊 Ecosystem Stats
279
+
280
+ ```python
281
+ from pyw.core import ecosystem_info
282
+
283
+ # Info sull'ecosistema installato
284
+ info = ecosystem_info()
285
+ print(f"Installed pyw modules: {len(info.modules)}")
286
+ for module in info.modules:
287
+ print(f" {module.name} v{module.version}")
288
+ ```
289
+
290
+ ### 🎯 Quality Assurance
291
+
292
+ ```python
293
+ from pyw.core.qa import (
294
+ validate_module, check_compatibility,
295
+ run_ecosystem_tests
296
+ )
297
+
298
+ # Valida un modulo pyw
299
+ issues = validate_module("pyw.mymodule")
300
+ if issues:
301
+ for issue in issues:
302
+ print(f"⚠️ {issue}")
303
+
304
+ # Check compatibilità tra moduli
305
+ compat = check_compatibility(["pyw-logger==1.0", "pyw-fs==2.0"])
306
+ assert compat.compatible
307
+ ```
308
+
309
+ ## Development Tools
310
+
311
+ ### 🏗️ Module Scaffolding
312
+
313
+ ```bash
314
+ # Crea nuovo modulo pyw
315
+ pyw-core scaffold my-module --type=utility
316
+ cd pyw-my-module/
317
+
318
+ # Struttura generata:
319
+ # pyw-my-module/
320
+ # ├── pyw/
321
+ # │ └── my_module/
322
+ # │ ├── __init__.py
323
+ # │ └── core.py
324
+ # ├── tests/
325
+ # ├── pyproject.toml
326
+ # └── README.md
327
+ ```
328
+
329
+ ### 📋 Quality Checks
330
+
331
+ ```bash
332
+ # Linting ecosystem-wide
333
+ pyw-core lint --all-modules
334
+
335
+ # Type checking
336
+ pyw-core mypy --strict
337
+
338
+ # Run all tests
339
+ pyw-core test --coverage
340
+
341
+ # Check dependencies
342
+ pyw-core deps --check-conflicts
343
+ ```
344
+
345
+ ## Roadmap
346
+
347
+ - 🏗️ **Enhanced utilities**: Async helpers, concurrency utilities
348
+ - 📦 **Plugin system**: Hot-reloading, dependency injection
349
+ - 🔧 **Dev experience**: Better debugging, profiling integration
350
+ - 📚 **Documentation**: Auto-generated API docs, examples
351
+ - 🎯 **Quality tools**: Advanced linting, security scanning
352
+ - 🌐 **Ecosystem**: Package discovery, compatibility matrix
353
+ - ⚡ **Performance**: Caching strategies, optimization helpers
354
+
355
+ ## Contributing
356
+
357
+ **pyw-core** è il cuore dell'ecosistema - ogni contributo deve essere attentamente valutato:
358
+
359
+ 1. **Fork & Clone**: `git clone https://github.com/pythonWoods/pyw-core.git`
360
+ 2. **Development setup**: `poetry install && poetry shell`
361
+ 3. **Quality checks**: `ruff check . && mypy && pytest`
362
+ 4. **Documentation**: Aggiorna docs per ogni modifica API
363
+ 5. **Compatibility**: Assicurati che le modifiche non rompano altri moduli
364
+ 6. **Pull Request**: CI esegue test completi dell'ecosistema
365
+
366
+ ## Architecture Notes
367
+
368
+ ```
369
+ pyw-core (namespace + utilities)
370
+ ├── pyw/__init__.py # Namespace package
371
+ ├── pyw/core/
372
+ │ ├── __init__.py # Public API exports
373
+ │ ├── base.py # BaseConfig, BaseModel
374
+ │ ├── utils.py # Common utilities
375
+ │ ├── types.py # Type aliases & helpers
376
+ │ ├── plugins.py # Plugin discovery
377
+ │ ├── performance.py # Performance tools
378
+ │ ├── testing.py # Test utilities
379
+ │ └── exceptions.py # Common exceptions
380
+ └── tests/ # Comprehensive test suite
381
+ ```
382
+
383
+ Felice coding nella foresta di **pythonWoods**! 🌲🐾
384
+
385
+ ## Links utili
386
+
387
+ Documentazione dev (work-in-progress) → https://pythonwoods.dev/docs/pyw-core/latest/
388
+
389
+ Issue tracker → https://github.com/pythonWoods/pyw-core/issues
390
+
391
+ Changelog → https://github.com/pythonWoods/pyw-core/releases
392
+
393
+ © pythonWoods — MIT License
@@ -0,0 +1,5 @@
1
+ pyw/__init__.py,sha256=TAxMvzzecHUbYSemZ7gBbqi-3hYmsODLKrbmxrtbaUQ,66
2
+ pyw_core-0.0.0.post3.dist-info/METADATA,sha256=4scpBtBFaUxPk37pngMqqe1PDP-SKZGz25MC-6n3cd4,10605
3
+ pyw_core-0.0.0.post3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
4
+ pyw_core-0.0.0.post3.dist-info/licenses/LICENSE,sha256=Jn96Lhnfqd-Zr3dFIJhaDlIZJSk-pbfnZ6sGlp0Gv5E,12
5
+ pyw_core-0.0.0.post3.dist-info/RECORD,,
@@ -1,71 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: pyw-core
3
- Version: 0.0.0.post1
4
- Summary: Reserved placeholder for pyw-core (umbrella namespace)
5
- Project-URL: Homepage, https://github.com/pythonWoods/pyw-core
6
- Project-URL: Documentation, https://pythonwoods.dev/docs/pyw-core/latest/
7
- Project-URL: Issues, https://github.com/pythonWoods/pyw-core/issues
8
- Project-URL: Changelog, https://github.com/pythonWoods/pyw-core/releases
9
- Author: pythonWoods
10
- License: MIT
11
- License-File: LICENSE
12
- Classifier: Development Status :: 2 - Pre-Alpha
13
- Classifier: License :: OSI Approved :: MIT License
14
- Classifier: Programming Language :: Python :: 3 :: Only
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Typing :: Typed
17
- Requires-Python: >=3.9
18
- Description-Content-Type: text/markdown
19
-
20
- # pyw-core 🌐
21
- [![PyPI](https://img.shields.io/pypi/v/pyw-core.svg)](https://pypi.org/project/pyw-core/)
22
- [![CI](https://github.com/pythonWoods/pyw-core/actions/workflows/ci.yml/badge.svg)](https://github.com/pythonWoods/pyw-core/actions/workflows/ci.yml)
23
- [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
24
- > Namespace seed & common utilities for the **pythonWoods** ecosystem.
25
-
26
- ## Components
27
-
28
- | Package | Description | Status |
29
- |---------|-------------|--------|
30
- | **pyw-core** | Structured + colorful logging | placeholder `0.0.0` |
31
- | **pyw-fs** | Unified filesystem (local/S3/GCS) | 0.0.0 |
32
- | **pyw-secret** | Secret back-ends (.env, Vault, SSM) | 0.0.0 |
33
- | **pyw-cli** | Typer CLI scaffold | 0.0.0 |
34
- | **pyw-music21** | Music21 stubs & helpers | 0.0.0 |
35
- | **pyw-musicparser** | Parse MIDI/Lilypond | 0.0.0 |
36
- | **pyw-core** | Meta-package: install everything | 0.0.0 |
37
- | **pyw-devtools** | Bundle for devs (logger, fs, cli, secret) | 0.0.0 |
38
-
39
- ## Philosophy
40
-
41
- * **Namespace package** – `import pyw.*` per evitare conflitti.
42
- * **Small, composable modules** – scegli solo ciò che ti serve.
43
- * **Typed APIs** – Pydantic / dataclass per zero sorprese.
44
- * **No heavy deps by default** – le librerie “costose” (Torch, OpenCV) sono extra.
45
-
46
- ### Installation (nothing to use yet)
47
-
48
- ```bash
49
- pip install pyw-core
50
- ```
51
-
52
- *(Core è quasi vuoto: fornisce solo il namespace e helper comuni.)*
53
-
54
- ## Contributing
55
-
56
- 1. Fork il repo del modulo che ti interessa (`pyw-fs`, ecc.).
57
- 2. Crea virtual-env via Poetry: `poetry install && poetry shell`.
58
- 3. Lancia linter e mypy: `ruff check . && mypy`.
59
- 4. Apri la PR: CI esegue lint, type-check, build.
60
-
61
- Felice coding nella foresta di **pythonWoods**! 🌲🐾
62
-
63
-
64
- ## Links utili
65
- Documentazione dev (work-in-progress) → https://pythonwoods.dev/docs/pyw-core/latest/
66
-
67
- Issue tracker → https://github.com/pythonWoods/pyw-core/issues
68
-
69
- Changelog → https://github.com/pythonWoods/pyw-core/releases
70
-
71
- © pythonWoods — MIT License
@@ -1,5 +0,0 @@
1
- pyw/__init__.py,sha256=TAxMvzzecHUbYSemZ7gBbqi-3hYmsODLKrbmxrtbaUQ,66
2
- pyw_core-0.0.0.post1.dist-info/METADATA,sha256=LphCqhvSw0LkMI0HfGQ5BQKBrRw-SA-TriXbRAW47AY,2733
3
- pyw_core-0.0.0.post1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
4
- pyw_core-0.0.0.post1.dist-info/licenses/LICENSE,sha256=Jn96Lhnfqd-Zr3dFIJhaDlIZJSk-pbfnZ6sGlp0Gv5E,12
5
- pyw_core-0.0.0.post1.dist-info/RECORD,,