python-quantumflow 2.0.0__tar.gz → 2.0.2__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.
Files changed (19) hide show
  1. python_quantumflow-2.0.2/PKG-INFO +39 -0
  2. {python_quantumflow-2.0.0 → python_quantumflow-2.0.2}/README.md +2 -2
  3. python_quantumflow-2.0.2/setup.py +43 -0
  4. python_quantumflow-2.0.2/src/python_quantumflow.egg-info/PKG-INFO +39 -0
  5. python_quantumflow-2.0.0/PKG-INFO +0 -399
  6. python_quantumflow-2.0.0/setup.py +0 -62
  7. python_quantumflow-2.0.0/src/python_quantumflow.egg-info/PKG-INFO +0 -399
  8. {python_quantumflow-2.0.0 → python_quantumflow-2.0.2}/pyproject.toml +0 -0
  9. {python_quantumflow-2.0.0 → python_quantumflow-2.0.2}/setup.cfg +0 -0
  10. {python_quantumflow-2.0.0 → python_quantumflow-2.0.2}/src/python_quantumflow.egg-info/SOURCES.txt +0 -0
  11. {python_quantumflow-2.0.0 → python_quantumflow-2.0.2}/src/python_quantumflow.egg-info/dependency_links.txt +0 -0
  12. {python_quantumflow-2.0.0 → python_quantumflow-2.0.2}/src/python_quantumflow.egg-info/top_level.txt +0 -0
  13. {python_quantumflow-2.0.0 → python_quantumflow-2.0.2}/src/quantumflow/__init__.py +0 -0
  14. {python_quantumflow-2.0.0 → python_quantumflow-2.0.2}/src/quantumflow/cli.py +0 -0
  15. {python_quantumflow-2.0.0 → python_quantumflow-2.0.2}/src/quantumflow/config.py +0 -0
  16. {python_quantumflow-2.0.0 → python_quantumflow-2.0.2}/src/quantumflow/core.py +0 -0
  17. {python_quantumflow-2.0.0 → python_quantumflow-2.0.2}/src/quantumflow/execution.py +0 -0
  18. {python_quantumflow-2.0.0 → python_quantumflow-2.0.2}/src/quantumflow/metrics.py +0 -0
  19. {python_quantumflow-2.0.0 → python_quantumflow-2.0.2}/src/quantumflow/validation.py +0 -0
@@ -0,0 +1,39 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-quantumflow
3
+ Version: 2.0.2
4
+ Summary: Python QuantumFlow: Advanced type conversion for Python
5
+ Home-page: https://github.com/magi8101/python-quantumflow
6
+ Author: Magi Sharma
7
+ Author-email: magi@example.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
+ Requires-Python: >=3.7
15
+ Description-Content-Type: text/markdown
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: classifier
19
+ Dynamic: description
20
+ Dynamic: description-content-type
21
+ Dynamic: home-page
22
+ Dynamic: requires-python
23
+ Dynamic: summary
24
+
25
+ # Python QuantumFlow
26
+
27
+ A next-generation type-and-data-flow framework for Python with a lightweight footprint.
28
+
29
+ ## Overview
30
+
31
+ Python QuantumFlow is a powerful yet lightweight framework that enhances Python's data flow capabilities.
32
+
33
+ ## Features
34
+
35
+ | Feature | Version 1.x | Version 2.x |
36
+ |---------|------------|-------------|
37
+ | Type Conversion | Basic types only | Complex nested structures |
38
+ | Error Handling | Manual try/except | Automatic with @retry |
39
+ | Async Support | Limited | Full async/await |
@@ -39,11 +39,11 @@ Python QuantumFlow 2.0 represents a major evolution from the original python-typ
39
39
  ### Version Comparison
40
40
 
41
41
  | Feature | Version 1.x | Version 2.x |
42
- | ---------------- | ----------------- | ---------------------------------- | --- |
42
+ |------------------|-------------------|-----------------------------------|
43
43
  | Type Conversion | Basic types only | Complex nested structures |
44
44
  | Error Handling | Manual try/except | Automatic with @retry |
45
45
  | Async Support | Limited | Full async/await with backpressure |
46
- | Flow Composition | Manual chaining | Operator-based (`>>`, `+`, ` | `) |
46
+ | Flow Composition | Manual chaining | Operator-based (`>>`, `+`, `\|`) |
47
47
  | Memory Usage | Moderate | Optimized with streaming support |
48
48
  | Visualization | None | Interactive flow diagrams |
49
49
  | CLI Tools | None | Complete development toolkit |
@@ -0,0 +1,43 @@
1
+
2
+ from setuptools import setup, find_packages
3
+
4
+ # Using direct string for the long description to avoid file loading issues
5
+ long_description = """# Python QuantumFlow
6
+
7
+ A next-generation type-and-data-flow framework for Python with a lightweight footprint.
8
+
9
+ ## Overview
10
+
11
+ Python QuantumFlow is a powerful yet lightweight framework that enhances Python's data flow capabilities.
12
+
13
+ ## Features
14
+
15
+ | Feature | Version 1.x | Version 2.x |
16
+ |---------|------------|-------------|
17
+ | Type Conversion | Basic types only | Complex nested structures |
18
+ | Error Handling | Manual try/except | Automatic with @retry |
19
+ | Async Support | Limited | Full async/await |
20
+ """
21
+
22
+ setup(
23
+ name="python-quantumflow",
24
+ version="2.0.2",
25
+ author="Magi Sharma",
26
+ author_email="magi@example.com",
27
+ description="Python QuantumFlow: Advanced type conversion for Python",
28
+ long_description=long_description,
29
+ long_description_content_type="text/markdown",
30
+ url="https://github.com/magi8101/python-quantumflow",
31
+ packages=find_packages(where="src"),
32
+ package_dir={"": "src"},
33
+ classifiers=[
34
+ "Programming Language :: Python :: 3",
35
+ "License :: OSI Approved :: MIT License",
36
+ "Operating System :: OS Independent",
37
+ "Development Status :: 5 - Production/Stable",
38
+ "Intended Audience :: Developers",
39
+ "Topic :: Software Development :: Libraries :: Python Modules",
40
+ ],
41
+ python_requires=">=3.7",
42
+ install_requires=[],
43
+ )
@@ -0,0 +1,39 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-quantumflow
3
+ Version: 2.0.2
4
+ Summary: Python QuantumFlow: Advanced type conversion for Python
5
+ Home-page: https://github.com/magi8101/python-quantumflow
6
+ Author: Magi Sharma
7
+ Author-email: magi@example.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
+ Requires-Python: >=3.7
15
+ Description-Content-Type: text/markdown
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: classifier
19
+ Dynamic: description
20
+ Dynamic: description-content-type
21
+ Dynamic: home-page
22
+ Dynamic: requires-python
23
+ Dynamic: summary
24
+
25
+ # Python QuantumFlow
26
+
27
+ A next-generation type-and-data-flow framework for Python with a lightweight footprint.
28
+
29
+ ## Overview
30
+
31
+ Python QuantumFlow is a powerful yet lightweight framework that enhances Python's data flow capabilities.
32
+
33
+ ## Features
34
+
35
+ | Feature | Version 1.x | Version 2.x |
36
+ |---------|------------|-------------|
37
+ | Type Conversion | Basic types only | Complex nested structures |
38
+ | Error Handling | Manual try/except | Automatic with @retry |
39
+ | Async Support | Limited | Full async/await |
@@ -1,399 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: python-quantumflow
3
- Version: 2.0.0
4
- Summary: Python QuantumFlow: Advanced type conversion for Python
5
- Home-page: https://github.com/magi8101/python-quantumflow
6
- Author: Magi Sharma
7
- Author-email: magi@example.com
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Development Status :: 5 - Production/Stable
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
- Requires-Python: >=3.7
15
- Description-Content-Type: text/markdown
16
- Dynamic: author
17
- Dynamic: author-email
18
- Dynamic: classifier
19
- Dynamic: description
20
- Dynamic: description-content-type
21
- Dynamic: home-page
22
- Dynamic: requires-python
23
- Dynamic: summary
24
-
25
- # ⚛️ Python QuantumFlow 🔄
26
-
27
- ![Version](https://img.shields.io/badge/version-0.6.1-blue.svg)
28
- ![Python](https://img.shields.io/badge/python-3.8+-brightgreen.svg)
29
- ![License](https://img.shields.io/badge/license-MIT-yellow.svg)
30
- ![Coolness](https://img.shields.io/badge/coolness-over_9000-blueviolet.svg)
31
- ![Status](https://img.shields.io/badge/status-quantum_entangled-orange.svg)
32
-
33
- ✨ A next-generation type-and-data-flow framework for Python with a lightweight footprint. 🚀
34
-
35
- ## 🌟 Overview
36
-
37
- 🔮 Python QuantumFlow is a powerful yet lightweight framework that enhances Python's data flow capabilities with:
38
-
39
- - 🔄 Automatic type conversion with `flow()` and `TypeFlowContext`
40
- - 🧩 Function decorators for creating intelligent flows with `@qflow`
41
- - ⚡ Asynchronous operations with `@async_flow`
42
- - 🛡️ Robust error handling with retry logic
43
- - 🎨 Beautiful terminal output with color and styling
44
- - 📊 Visualization of data flows
45
- - 🔁 ETL pipeline creation and orchestration
46
- - 🧪 Advanced testing support for flow validation
47
- - 📈 Performance monitoring and optimization tools
48
- - 🔍 Debugging and introspection capabilities
49
- - 🌐 Distributed computing integration
50
-
51
- ## 🚀 What's New in Version 2.0
52
-
53
- Python QuantumFlow 2.0 represents a major evolution from the original python-typeflow, with significant improvements:
54
-
55
- ### Key Enhancements
56
-
57
- - ⚡ **Performance Boost**: Up to 3x faster type conversions and flow execution
58
- - 🧠 **Smarter Type Inference**: Improved algorithm for detecting and converting complex nested types
59
- - 🔄 **Flow Composition**: Chain and combine flows with intuitive operators
60
- - 🌐 **Extended Ecosystem**: New integrations with popular data science and ML frameworks
61
- - 🧪 **Enhanced Testing Tools**: Built-in utilities for testing flows and mocking data sources
62
-
63
- ### Version Comparison
64
-
65
- | Feature | Version 1.x | Version 2.x |
66
- | ---------------- | ----------------- | ---------------------------------- | --- |
67
- | Type Conversion | Basic types only | Complex nested structures |
68
- | Error Handling | Manual try/except | Automatic with @retry |
69
- | Async Support | Limited | Full async/await with backpressure |
70
- | Flow Composition | Manual chaining | Operator-based (`>>`, `+`, ` | `) |
71
- | Memory Usage | Moderate | Optimized with streaming support |
72
- | Visualization | None | Interactive flow diagrams |
73
- | CLI Tools | None | Complete development toolkit |
74
-
75
- ### Migration from v1.x
76
-
77
- Upgrading from python-typeflow 1.x to Python QuantumFlow 2.x is straightforward:
78
-
79
- ```python
80
- # Old way (python-typeflow 1.x)
81
- from python_typeflow import convert_type, apply_flow
82
-
83
- result = apply_flow(data, convert_type(str))
84
-
85
- # New way (Python QuantumFlow 2.x)
86
- from python_quantumflow.core import flow
87
-
88
- result = flow(lambda x: str(x))(data)
89
- # or even simpler
90
- result = flow(str)(data)
91
- ```
92
-
93
- <details>
94
- <summary>📚 Complete migration guide</summary>
95
-
96
- For a complete guide to migrating your code from python-typeflow 1.x to Python QuantumFlow 2.x,
97
- see our [Migration Guide](https://docs.quantumflow.dev/migration).
98
-
99
- Key differences:
100
-
101
- - Decorator syntax changes
102
- - New context manager approach
103
- - Enhanced error handling
104
- - Parallel and distributed execution options
105
-
106
- </details>
107
-
108
- ## 📦 Installation
109
-
110
- ```bash
111
- # Install core package
112
- pip install python-quantumflow
113
-
114
- # Install with additional features
115
- pip install python-quantumflow[viz] # Visualization features
116
- pip install python-quantumflow[async] # Enhanced async capabilities
117
- pip install python-quantumflow[ml] # Machine learning integrations
118
- pip install python-quantumflow[full] # All features
119
- ```
120
-
121
- ## 🚀 Quick Start
122
-
123
- ### Basic Type Flow
124
-
125
- ```python
126
- from python_quantumflow.core import flow, with_typeflow as TypeFlowContext
127
-
128
- # Create a list of numbers
129
- numbers = [1, 2, 3, 4, 5]
130
-
131
- # Convert types using flow
132
- numbers_str = flow(lambda x: str(x))(numbers)
133
- sum_str = flow(lambda x: str(x))(sum(numbers))
134
-
135
- # Combine the results
136
- result = f"{numbers_str} items with sum: {sum_str}"
137
- print(result)
138
- ```
139
-
140
- <details>
141
- <summary>👉 Click to see output</summary>
142
-
143
- ```
144
- [1, 2, 3, 4, 5] items with sum: 15
145
- ```
146
-
147
- </details>
148
-
149
- ### Function Flows with @qflow
150
-
151
- ```python
152
- from python_quantumflow.core import qflow
153
-
154
- @qflow
155
- def process_data(items):
156
- """Process a list of items by doubling each value."""
157
- return [item * 2 for item in items]
158
-
159
- data = [5, 10, 15, 20, 25]
160
- result = process_data(data)
161
- print(f"Processed data: {result}")
162
- ```
163
-
164
- <details>
165
- <summary>👉 Click to see output</summary>
166
-
167
- ```
168
- Processed data: [10, 20, 30, 40, 50]
169
- ```
170
-
171
- </details>
172
-
173
- ### Async Flow with Retry
174
-
175
- ```python
176
- import asyncio
177
- from python_quantumflow.core import async_flow, retry, fancy_print
178
-
179
- @async_flow
180
- @retry(max_attempts=3, backoff_factor=0.5)
181
- async def fetch_remote_data(url):
182
- """Fetch data from a URL with automatic retry on failure."""
183
- await asyncio.sleep(0.2) # Simulate network delay
184
-
185
- # Your network request logic here
186
- return f"Data from {url}"
187
-
188
- async def main():
189
- urls = ["https://api.example.com/data/1", "https://api.example.com/data/2"]
190
- tasks = [fetch_remote_data(url) for url in urls]
191
- results = await asyncio.gather(*tasks, return_exceptions=True)
192
-
193
- # Process results
194
- for url, result in zip(urls, results):
195
- if isinstance(result, Exception):
196
- fancy_print(f"Failed to fetch {url}: {result}", style="red")
197
- else:
198
- fancy_print(f"Success: {result}", style="green")
199
-
200
- if __name__ == "__main__":
201
- asyncio.run(main())
202
- ```
203
-
204
- <details>
205
- <summary>👉 Click to see output</summary>
206
-
207
- ```
208
- Success: Data from https://api.example.com/data/1
209
- Success: Data from https://api.example.com/data/2
210
- ```
211
-
212
- With failures (when network errors occur):
213
-
214
- ```
215
- Request to https://api.example.com/data/1 failed, retrying...
216
- Failed to fetch https://api.example.com/data/1: Failed to connect
217
- Success: Data from https://api.example.com/data/2
218
- ```
219
-
220
- </details>
221
-
222
- ### Color and Styling
223
-
224
- ```python
225
- from python_quantumflow.core import fancy_print
226
-
227
- # Styled output with explicit styling
228
- fancy_print("Error: Connection failed", style="bold red")
229
- fancy_print("Success: Operation completed", style="bold green")
230
- fancy_print("Info: Processing data", style="cyan")
231
-
232
- # Auto-styled output based on content
233
- fancy_print("Error: This will be red automatically")
234
- fancy_print("Success! This will be green automatically")
235
- fancy_print("Warning: This will be yellow automatically")
236
- ```
237
-
238
- <details>
239
- <summary>👉 Click to see output</summary>
240
-
241
- ![Terminal Output](https://raw.githubusercontent.com/magi8101/quantumflow/main/assets/terminal_output.png)
242
-
243
- _Note: Colors shown will vary based on your terminal_
244
-
245
- </details>
246
-
247
- ### ETL Pipeline Example
248
-
249
- ```python
250
- from python_quantumflow.core import qflow, fancy_print
251
-
252
- @qflow
253
- def extract(source):
254
- """Extract data from a source."""
255
- fancy_print(f"Extracting from {source}...", style="dim")
256
- return [1, 2, 3, 4, 5]
257
-
258
- @qflow
259
- def transform(data):
260
- """Transform the raw data."""
261
- fancy_print(f"Transforming {data}...", style="dim")
262
- return [item * 2 for item in data]
263
-
264
- @qflow
265
- def load(transformed_data):
266
- """Load the transformed data."""
267
- fancy_print(f"Loading {transformed_data}...", style="dim")
268
- return f"Loaded {len(transformed_data)} items"
269
-
270
- @qflow
271
- def etl_pipeline(source):
272
- """Complete ETL pipeline."""
273
- raw_data = extract(source)
274
- transformed_data = transform(raw_data)
275
- result = load(transformed_data)
276
- return result
277
-
278
- result = etl_pipeline("database://example/table1")
279
- fancy_print(f"Pipeline result: {result}", style="bold green")
280
- ```
281
-
282
- <details>
283
- <summary>👉 Click to see output</summary>
284
-
285
- ```
286
- Extracting from database://example/table1...
287
- Transforming [1, 2, 3, 4, 5]...
288
- Loading [2, 4, 6, 8, 10]...
289
- Pipeline result: Loaded 5 items
290
- ```
291
-
292
- </details>
293
-
294
- ## 🧰 Key Components
295
-
296
- - **Core Flow Functions**:
297
-
298
- - `flow()`: Wraps objects for type conversion
299
- - `TypeFlowContext`: Context for automatic type conversion
300
- - `qflow`: Decorator for creating flow functions
301
- - `async_flow`: Decorator for asynchronous flows
302
-
303
- - **Error Handling**:
304
-
305
- - `retry`: Decorator for automatic retry on failure
306
- - Exception handling within flows
307
-
308
- - **Terminal Enhancements**:
309
- - `fancy_print`: Rich terminal output with colors and styles
310
- - Auto-styling based on message content
311
- - Progress indicators and animations
312
-
313
- ## 🖥️ Command Line Interface
314
-
315
- Python QuantumFlow includes a CLI for rapid development and learning:
316
-
317
- ```bash
318
- # Start interactive playground
319
- pqflow play
320
-
321
- # Start guided tutorial
322
- pqflow tutor
323
-
324
- # Generate documentation for flows
325
- pqflow autodoc your_module
326
-
327
- # Run a flow
328
- pqflow run your_module.your_flow --input data.json
329
-
330
- # Visualize a flow
331
- pqflow visualize your_module.your_flow --output flow.png
332
-
333
- # Create a new Python QuantumFlow project
334
- pqflow init my_project
335
-
336
- # View performance metrics for flows
337
- pqflow metrics your_module.your_flow
338
-
339
- # Run flow with default colorized output
340
- pqflow run --color your_module.your_flow
341
-
342
- # Apply type conversions to a JSON file
343
- pqflow convert input.json output.json --schema schema.json
344
-
345
- # Start a web dashboard for monitoring flows
346
- pqflow dashboard --port 8080
347
-
348
- # Generate sample code from templates
349
- pqflow generate etl --name data_pipeline
350
-
351
- # Benchmark flow performance
352
- pqflow benchmark your_module.your_flow --iterations 1000
353
- ```
354
-
355
- <details>
356
- <summary>👉 Click to see CLI in action</summary>
357
-
358
- ![CLI Demo](https://raw.githubusercontent.com/magi8101/quantumflow/main/assets/cli_demo.gif)
359
-
360
- _The Python QuantumFlow CLI provides a fun, interactive way to learn and use the framework._
361
-
362
- </details>
363
-
364
- ## 🔬 Advanced Features
365
-
366
- - **📊 Metrics and Observability**: Monitor and track flow execution
367
- - **✅ Validation**: Validate flow inputs and outputs
368
- - **⚙️ Execution Backends**: Run flows in different execution contexts (threads, processes, distributed)
369
-
370
- ## 📊 Performance
371
-
372
- Python QuantumFlow is optimized for both performance and flexibility.
373
-
374
- | Feature | Performance | Memory Usage | Quantum Awesomeness |
375
- | ---------------- | ----------- | ------------ | ------------------- |
376
- | Type Conversion | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ |
377
- | Flow Execution | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
378
- | Async Operations | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
379
- | Fancy Output | ⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
380
-
381
- ## 🧠 Why Python QuantumFlow?
382
-
383
- - **Lightweight**: Minimal dependencies, small footprint
384
- - **Intuitive**: Simple API with powerful capabilities
385
- - **Flexible**: Works with your existing code
386
- - **Pretty**: Makes your terminal output gorgeous
387
- - **Fast**: Optimized for performance
388
-
389
- ## 🙌 Created By
390
-
391
- <img src="https://github.com/magi8101.png" width="70" style="border-radius: 50%;" align="left" alt="Magi Sharma"/>
392
-
393
- **[Magi Sharma](https://github.com/magi8101/python-quantumflow)**<br>
394
- _Quantum-entangled code enthusiast_<br>
395
- Version: 0.6.1
396
-
397
- ---
398
-
399
- <p align="center">Made with ❤️ and a sprinkle of quantum magic</p>
@@ -1,62 +0,0 @@
1
- #!/usr/bin/env python
2
- import os
3
- from setuptools import setup, find_packages, Command
4
- from setuptools.command.develop import develop
5
- from setuptools.command.install import install
6
- import shutil
7
- import sys
8
- import io
9
-
10
- # Use io.open with explicit encoding to avoid UnicodeDecodeError
11
- with io.open("README.md", encoding="utf-8") as f:
12
- long_description = f.read()
13
-
14
- class VerifyFlowsCommand(Command):
15
- """Custom command to verify all .qflow definitions."""
16
- description = "Lint and validate all .qflow definitions"
17
- user_options = []
18
-
19
- def initialize_options(self):
20
- pass
21
-
22
- def finalize_options(self):
23
- pass
24
-
25
- def run(self):
26
- """Run the verification process."""
27
- print("Verifying flow definitions...")
28
- try:
29
- from src.quantumflow.validation import validate_flows
30
- validate_flows()
31
- print("All flows verified successfully!")
32
- except ImportError:
33
- print("Error: quantumflow package not installed. Install the package first.")
34
- sys.exit(1)
35
- except Exception as e:
36
- print(f"Error verifying flows: {e}")
37
- sys.exit(1)
38
-
39
- setup(
40
- name="python-quantumflow",
41
- version="2.0.0",
42
- author="Magi Sharma",
43
- author_email="magi@example.com",
44
- description="Python QuantumFlow: Advanced type conversion for Python",
45
- long_description=long_description,
46
- long_description_content_type="text/markdown",
47
- url="https://github.com/magi8101/python-quantumflow",
48
- packages=find_packages(where="src"),
49
- package_dir={"": "src"},
50
- classifiers=[
51
- "Programming Language :: Python :: 3",
52
- "License :: OSI Approved :: MIT License",
53
- "Operating System :: OS Independent",
54
- "Development Status :: 5 - Production/Stable",
55
- "Intended Audience :: Developers",
56
- "Topic :: Software Development :: Libraries :: Python Modules",
57
- ],
58
- python_requires=">=3.7",
59
- install_requires=[
60
- # Add dependencies here
61
- ],
62
- )
@@ -1,399 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: python-quantumflow
3
- Version: 2.0.0
4
- Summary: Python QuantumFlow: Advanced type conversion for Python
5
- Home-page: https://github.com/magi8101/python-quantumflow
6
- Author: Magi Sharma
7
- Author-email: magi@example.com
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Development Status :: 5 - Production/Stable
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
- Requires-Python: >=3.7
15
- Description-Content-Type: text/markdown
16
- Dynamic: author
17
- Dynamic: author-email
18
- Dynamic: classifier
19
- Dynamic: description
20
- Dynamic: description-content-type
21
- Dynamic: home-page
22
- Dynamic: requires-python
23
- Dynamic: summary
24
-
25
- # ⚛️ Python QuantumFlow 🔄
26
-
27
- ![Version](https://img.shields.io/badge/version-0.6.1-blue.svg)
28
- ![Python](https://img.shields.io/badge/python-3.8+-brightgreen.svg)
29
- ![License](https://img.shields.io/badge/license-MIT-yellow.svg)
30
- ![Coolness](https://img.shields.io/badge/coolness-over_9000-blueviolet.svg)
31
- ![Status](https://img.shields.io/badge/status-quantum_entangled-orange.svg)
32
-
33
- ✨ A next-generation type-and-data-flow framework for Python with a lightweight footprint. 🚀
34
-
35
- ## 🌟 Overview
36
-
37
- 🔮 Python QuantumFlow is a powerful yet lightweight framework that enhances Python's data flow capabilities with:
38
-
39
- - 🔄 Automatic type conversion with `flow()` and `TypeFlowContext`
40
- - 🧩 Function decorators for creating intelligent flows with `@qflow`
41
- - ⚡ Asynchronous operations with `@async_flow`
42
- - 🛡️ Robust error handling with retry logic
43
- - 🎨 Beautiful terminal output with color and styling
44
- - 📊 Visualization of data flows
45
- - 🔁 ETL pipeline creation and orchestration
46
- - 🧪 Advanced testing support for flow validation
47
- - 📈 Performance monitoring and optimization tools
48
- - 🔍 Debugging and introspection capabilities
49
- - 🌐 Distributed computing integration
50
-
51
- ## 🚀 What's New in Version 2.0
52
-
53
- Python QuantumFlow 2.0 represents a major evolution from the original python-typeflow, with significant improvements:
54
-
55
- ### Key Enhancements
56
-
57
- - ⚡ **Performance Boost**: Up to 3x faster type conversions and flow execution
58
- - 🧠 **Smarter Type Inference**: Improved algorithm for detecting and converting complex nested types
59
- - 🔄 **Flow Composition**: Chain and combine flows with intuitive operators
60
- - 🌐 **Extended Ecosystem**: New integrations with popular data science and ML frameworks
61
- - 🧪 **Enhanced Testing Tools**: Built-in utilities for testing flows and mocking data sources
62
-
63
- ### Version Comparison
64
-
65
- | Feature | Version 1.x | Version 2.x |
66
- | ---------------- | ----------------- | ---------------------------------- | --- |
67
- | Type Conversion | Basic types only | Complex nested structures |
68
- | Error Handling | Manual try/except | Automatic with @retry |
69
- | Async Support | Limited | Full async/await with backpressure |
70
- | Flow Composition | Manual chaining | Operator-based (`>>`, `+`, ` | `) |
71
- | Memory Usage | Moderate | Optimized with streaming support |
72
- | Visualization | None | Interactive flow diagrams |
73
- | CLI Tools | None | Complete development toolkit |
74
-
75
- ### Migration from v1.x
76
-
77
- Upgrading from python-typeflow 1.x to Python QuantumFlow 2.x is straightforward:
78
-
79
- ```python
80
- # Old way (python-typeflow 1.x)
81
- from python_typeflow import convert_type, apply_flow
82
-
83
- result = apply_flow(data, convert_type(str))
84
-
85
- # New way (Python QuantumFlow 2.x)
86
- from python_quantumflow.core import flow
87
-
88
- result = flow(lambda x: str(x))(data)
89
- # or even simpler
90
- result = flow(str)(data)
91
- ```
92
-
93
- <details>
94
- <summary>📚 Complete migration guide</summary>
95
-
96
- For a complete guide to migrating your code from python-typeflow 1.x to Python QuantumFlow 2.x,
97
- see our [Migration Guide](https://docs.quantumflow.dev/migration).
98
-
99
- Key differences:
100
-
101
- - Decorator syntax changes
102
- - New context manager approach
103
- - Enhanced error handling
104
- - Parallel and distributed execution options
105
-
106
- </details>
107
-
108
- ## 📦 Installation
109
-
110
- ```bash
111
- # Install core package
112
- pip install python-quantumflow
113
-
114
- # Install with additional features
115
- pip install python-quantumflow[viz] # Visualization features
116
- pip install python-quantumflow[async] # Enhanced async capabilities
117
- pip install python-quantumflow[ml] # Machine learning integrations
118
- pip install python-quantumflow[full] # All features
119
- ```
120
-
121
- ## 🚀 Quick Start
122
-
123
- ### Basic Type Flow
124
-
125
- ```python
126
- from python_quantumflow.core import flow, with_typeflow as TypeFlowContext
127
-
128
- # Create a list of numbers
129
- numbers = [1, 2, 3, 4, 5]
130
-
131
- # Convert types using flow
132
- numbers_str = flow(lambda x: str(x))(numbers)
133
- sum_str = flow(lambda x: str(x))(sum(numbers))
134
-
135
- # Combine the results
136
- result = f"{numbers_str} items with sum: {sum_str}"
137
- print(result)
138
- ```
139
-
140
- <details>
141
- <summary>👉 Click to see output</summary>
142
-
143
- ```
144
- [1, 2, 3, 4, 5] items with sum: 15
145
- ```
146
-
147
- </details>
148
-
149
- ### Function Flows with @qflow
150
-
151
- ```python
152
- from python_quantumflow.core import qflow
153
-
154
- @qflow
155
- def process_data(items):
156
- """Process a list of items by doubling each value."""
157
- return [item * 2 for item in items]
158
-
159
- data = [5, 10, 15, 20, 25]
160
- result = process_data(data)
161
- print(f"Processed data: {result}")
162
- ```
163
-
164
- <details>
165
- <summary>👉 Click to see output</summary>
166
-
167
- ```
168
- Processed data: [10, 20, 30, 40, 50]
169
- ```
170
-
171
- </details>
172
-
173
- ### Async Flow with Retry
174
-
175
- ```python
176
- import asyncio
177
- from python_quantumflow.core import async_flow, retry, fancy_print
178
-
179
- @async_flow
180
- @retry(max_attempts=3, backoff_factor=0.5)
181
- async def fetch_remote_data(url):
182
- """Fetch data from a URL with automatic retry on failure."""
183
- await asyncio.sleep(0.2) # Simulate network delay
184
-
185
- # Your network request logic here
186
- return f"Data from {url}"
187
-
188
- async def main():
189
- urls = ["https://api.example.com/data/1", "https://api.example.com/data/2"]
190
- tasks = [fetch_remote_data(url) for url in urls]
191
- results = await asyncio.gather(*tasks, return_exceptions=True)
192
-
193
- # Process results
194
- for url, result in zip(urls, results):
195
- if isinstance(result, Exception):
196
- fancy_print(f"Failed to fetch {url}: {result}", style="red")
197
- else:
198
- fancy_print(f"Success: {result}", style="green")
199
-
200
- if __name__ == "__main__":
201
- asyncio.run(main())
202
- ```
203
-
204
- <details>
205
- <summary>👉 Click to see output</summary>
206
-
207
- ```
208
- Success: Data from https://api.example.com/data/1
209
- Success: Data from https://api.example.com/data/2
210
- ```
211
-
212
- With failures (when network errors occur):
213
-
214
- ```
215
- Request to https://api.example.com/data/1 failed, retrying...
216
- Failed to fetch https://api.example.com/data/1: Failed to connect
217
- Success: Data from https://api.example.com/data/2
218
- ```
219
-
220
- </details>
221
-
222
- ### Color and Styling
223
-
224
- ```python
225
- from python_quantumflow.core import fancy_print
226
-
227
- # Styled output with explicit styling
228
- fancy_print("Error: Connection failed", style="bold red")
229
- fancy_print("Success: Operation completed", style="bold green")
230
- fancy_print("Info: Processing data", style="cyan")
231
-
232
- # Auto-styled output based on content
233
- fancy_print("Error: This will be red automatically")
234
- fancy_print("Success! This will be green automatically")
235
- fancy_print("Warning: This will be yellow automatically")
236
- ```
237
-
238
- <details>
239
- <summary>👉 Click to see output</summary>
240
-
241
- ![Terminal Output](https://raw.githubusercontent.com/magi8101/quantumflow/main/assets/terminal_output.png)
242
-
243
- _Note: Colors shown will vary based on your terminal_
244
-
245
- </details>
246
-
247
- ### ETL Pipeline Example
248
-
249
- ```python
250
- from python_quantumflow.core import qflow, fancy_print
251
-
252
- @qflow
253
- def extract(source):
254
- """Extract data from a source."""
255
- fancy_print(f"Extracting from {source}...", style="dim")
256
- return [1, 2, 3, 4, 5]
257
-
258
- @qflow
259
- def transform(data):
260
- """Transform the raw data."""
261
- fancy_print(f"Transforming {data}...", style="dim")
262
- return [item * 2 for item in data]
263
-
264
- @qflow
265
- def load(transformed_data):
266
- """Load the transformed data."""
267
- fancy_print(f"Loading {transformed_data}...", style="dim")
268
- return f"Loaded {len(transformed_data)} items"
269
-
270
- @qflow
271
- def etl_pipeline(source):
272
- """Complete ETL pipeline."""
273
- raw_data = extract(source)
274
- transformed_data = transform(raw_data)
275
- result = load(transformed_data)
276
- return result
277
-
278
- result = etl_pipeline("database://example/table1")
279
- fancy_print(f"Pipeline result: {result}", style="bold green")
280
- ```
281
-
282
- <details>
283
- <summary>👉 Click to see output</summary>
284
-
285
- ```
286
- Extracting from database://example/table1...
287
- Transforming [1, 2, 3, 4, 5]...
288
- Loading [2, 4, 6, 8, 10]...
289
- Pipeline result: Loaded 5 items
290
- ```
291
-
292
- </details>
293
-
294
- ## 🧰 Key Components
295
-
296
- - **Core Flow Functions**:
297
-
298
- - `flow()`: Wraps objects for type conversion
299
- - `TypeFlowContext`: Context for automatic type conversion
300
- - `qflow`: Decorator for creating flow functions
301
- - `async_flow`: Decorator for asynchronous flows
302
-
303
- - **Error Handling**:
304
-
305
- - `retry`: Decorator for automatic retry on failure
306
- - Exception handling within flows
307
-
308
- - **Terminal Enhancements**:
309
- - `fancy_print`: Rich terminal output with colors and styles
310
- - Auto-styling based on message content
311
- - Progress indicators and animations
312
-
313
- ## 🖥️ Command Line Interface
314
-
315
- Python QuantumFlow includes a CLI for rapid development and learning:
316
-
317
- ```bash
318
- # Start interactive playground
319
- pqflow play
320
-
321
- # Start guided tutorial
322
- pqflow tutor
323
-
324
- # Generate documentation for flows
325
- pqflow autodoc your_module
326
-
327
- # Run a flow
328
- pqflow run your_module.your_flow --input data.json
329
-
330
- # Visualize a flow
331
- pqflow visualize your_module.your_flow --output flow.png
332
-
333
- # Create a new Python QuantumFlow project
334
- pqflow init my_project
335
-
336
- # View performance metrics for flows
337
- pqflow metrics your_module.your_flow
338
-
339
- # Run flow with default colorized output
340
- pqflow run --color your_module.your_flow
341
-
342
- # Apply type conversions to a JSON file
343
- pqflow convert input.json output.json --schema schema.json
344
-
345
- # Start a web dashboard for monitoring flows
346
- pqflow dashboard --port 8080
347
-
348
- # Generate sample code from templates
349
- pqflow generate etl --name data_pipeline
350
-
351
- # Benchmark flow performance
352
- pqflow benchmark your_module.your_flow --iterations 1000
353
- ```
354
-
355
- <details>
356
- <summary>👉 Click to see CLI in action</summary>
357
-
358
- ![CLI Demo](https://raw.githubusercontent.com/magi8101/quantumflow/main/assets/cli_demo.gif)
359
-
360
- _The Python QuantumFlow CLI provides a fun, interactive way to learn and use the framework._
361
-
362
- </details>
363
-
364
- ## 🔬 Advanced Features
365
-
366
- - **📊 Metrics and Observability**: Monitor and track flow execution
367
- - **✅ Validation**: Validate flow inputs and outputs
368
- - **⚙️ Execution Backends**: Run flows in different execution contexts (threads, processes, distributed)
369
-
370
- ## 📊 Performance
371
-
372
- Python QuantumFlow is optimized for both performance and flexibility.
373
-
374
- | Feature | Performance | Memory Usage | Quantum Awesomeness |
375
- | ---------------- | ----------- | ------------ | ------------------- |
376
- | Type Conversion | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ |
377
- | Flow Execution | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
378
- | Async Operations | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
379
- | Fancy Output | ⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
380
-
381
- ## 🧠 Why Python QuantumFlow?
382
-
383
- - **Lightweight**: Minimal dependencies, small footprint
384
- - **Intuitive**: Simple API with powerful capabilities
385
- - **Flexible**: Works with your existing code
386
- - **Pretty**: Makes your terminal output gorgeous
387
- - **Fast**: Optimized for performance
388
-
389
- ## 🙌 Created By
390
-
391
- <img src="https://github.com/magi8101.png" width="70" style="border-radius: 50%;" align="left" alt="Magi Sharma"/>
392
-
393
- **[Magi Sharma](https://github.com/magi8101/python-quantumflow)**<br>
394
- _Quantum-entangled code enthusiast_<br>
395
- Version: 0.6.1
396
-
397
- ---
398
-
399
- <p align="center">Made with ❤️ and a sprinkle of quantum magic</p>