Metadata-Version: 2.4
Name: vibeblocks
Version: 0.1.4
Summary: Lightweight Python workflow orchestration library for AI agents, async task execution, retries, and failure-safe automation.
Project-URL: Homepage, https://github.com/AADigitalBusiness/vibeblocks
Project-URL: Documentation, https://vibeblocks.aadigitalbusiness.com
Project-URL: Issues, https://github.com/AADigitalBusiness/vibeblocks/issues
Project-URL: Repository, https://github.com/AADigitalBusiness/vibeblocks
Project-URL: Source, https://github.com/AADigitalBusiness/vibeblocks
Project-URL: Changelog, https://github.com/AADigitalBusiness/vibeblocks/blob/main/CHANGELOG.md
Author-email: Alejandro Avendaño <aavendano79@gmail.com>
Maintainer-email: AADigitalBusiness <admin@aadigitalbusiness.com>
License: MIT License
        
        Copyright (c) 2024 Alejandro Avendaño
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: ai agents,async workflows,failure recovery,llm orchestration,python automation,retry logic,task execution,workflow orchestration
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Distributed Computing
Classifier: Typing :: Typed
Requires-Python: >=3.8
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: hatchling; extra == 'dev'
Requires-Dist: mkdocs-material; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material; extra == 'docs'
Provides-Extra: release
Requires-Dist: build; extra == 'release'
Requires-Dist: hatchling; extra == 'release'
Requires-Dist: twine; extra == 'release'
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Description-Content-Type: text/markdown

<!-- @format -->

# VibeBlocks

**AI-First Orchestration for Python.**

VibeBlocks evolves the concept of task orchestration into an AI-ready framework. It maintains the "Zero-Gravity" architecture (no external dependencies) while introducing a Semantic Layer for LLM integration and dynamic flow generation.

## Key Concepts

1.  **Block:** The atomic unit of execution.
2.  **Chain:** A linear sequence of Blocks.
3.  **Flow:** High-level orchestrator with failure strategies.

## Installation

```bash
pip install vibeblocks
```

## Quick Start

### 1. Classic Usage

```python
from vibeblocks import Flow, ExecutionContext, block, execute_flow

# 1. Define your blocks with @block decorator
@block(description="Extracts data from source")
def extract(ctx: ExecutionContext):
    print("Extracting data...")
    ctx.data["raw"] = [1, 2, 3, 4, 5]
    return ctx.data["raw"]

@block(description="Doubles the input values")
def transform(ctx: ExecutionContext):
    print("Transforming data...")
    data = ctx.data["raw"]
    ctx.data['processed'] = [x * 2 for x in data]
    return ctx.data['processed']

@block(description="Loads data to destination")
def load(ctx: ExecutionContext):
    print(f"Loading data: {ctx.data['processed']}")
    return True

# 2. Create the Flow
pipeline = Flow("ETL_Flow", [extract, transform, load])

# 3. Execute
result = execute_flow(pipeline, data={})

if result.status == "SUCCESS":
    print("Flow completed successfully!")
else:
    print(f"Flow failed: {result.errors}")
```

### 2. AI-Driven Dynamic Flows

VibeBlocks allows LLMs to generate flows on the fly using JSON schemas.

```python
from vibeblocks.vibeblocks import VibeBlocks

# JSON definition (could come from an LLM)
flow_request = {
    "name": "DynamicETL",
    "blocks": ["extract", "transform", "load"],
    "strategy": "ABORT"
}

# Available blocks registry
blocks_registry = {
    "extract": extract,
    "transform": transform,
    "load": load
}

# Execute dynamically
result = VibeBlocks.run_from_json(flow_request, initial_data={}, available_blocks=blocks_registry)
```

## License

MIT License. See [LICENSE](LICENSE) for details.
