Metadata-Version: 2.4
Name: waldiez
Version: 0.3.2
Summary: waldiez
Project-URL: homepage, https://waldiez.github.io/waldiez/python
Project-URL: repository, https://github.com/waldiez/python.git
Author-email: Panagiotis Kasnesis <pkasnesis@waldiez.io>, Lazaros Toumanidis <laztoum@waldiez.io>, Stella Ioannidou <stella@humancentered.gr>
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: <3.13,>=3.10
Requires-Dist: asyncer==0.0.8
Requires-Dist: httpx<0.28.0,>=0.27.0
Requires-Dist: jupytext
Requires-Dist: pandas>=2
Requires-Dist: parso==0.8.4
Requires-Dist: pyautogen==0.7.1
Requires-Dist: pydantic<3,>=2.6.1
Requires-Dist: typer<0.13,>=0.9
Provides-Extra: ag2-extras
Requires-Dist: autogen[captainagent]==0.7.1; (platform_system == 'Linux') and extra == 'ag2-extras'
Requires-Dist: pgvector>=0.3.6; extra == 'ag2-extras'
Requires-Dist: psycopg[binary]>=3.2.3; extra == 'ag2-extras'
Requires-Dist: pyautogen[anthropic]==0.7.1; extra == 'ag2-extras'
Requires-Dist: pyautogen[bedrock]==0.7.1; extra == 'ag2-extras'
Requires-Dist: pyautogen[gemini]==0.7.1; extra == 'ag2-extras'
Requires-Dist: pyautogen[groq]==0.7.1; extra == 'ag2-extras'
Requires-Dist: pyautogen[lmm]==0.7.1; extra == 'ag2-extras'
Requires-Dist: pyautogen[mistral]==0.7.1; extra == 'ag2-extras'
Requires-Dist: pyautogen[neo4j]==0.7.1; extra == 'ag2-extras'
Requires-Dist: pyautogen[retrievechat-mongodb]==0.7.1; extra == 'ag2-extras'
Requires-Dist: pyautogen[retrievechat-pgvector]==0.7.1; extra == 'ag2-extras'
Requires-Dist: pyautogen[retrievechat-qdrant]==0.7.1; (python_version < '3.13') and extra == 'ag2-extras'
Requires-Dist: pyautogen[retrievechat]==0.7.1; extra == 'ag2-extras'
Requires-Dist: pyautogen[together]==0.7.1; extra == 'ag2-extras'
Requires-Dist: pyautogen[websurfer]==0.7.1; extra == 'ag2-extras'
Requires-Dist: pymongo==4.10.1; extra == 'ag2-extras'
Requires-Dist: qdrant-client[fastembed]; (python_version >= '3.13') and extra == 'ag2-extras'
Provides-Extra: dev
Requires-Dist: autoflake==2.3.1; extra == 'dev'
Requires-Dist: bandit==1.8.2; extra == 'dev'
Requires-Dist: black[jupyter]==24.10.0; extra == 'dev'
Requires-Dist: flake8==7.1.1; extra == 'dev'
Requires-Dist: isort==5.13.2; extra == 'dev'
Requires-Dist: mypy==1.14.1; extra == 'dev'
Requires-Dist: pandas-stubs; extra == 'dev'
Requires-Dist: pre-commit==4.1.0; extra == 'dev'
Requires-Dist: pydocstyle==6.3.0; extra == 'dev'
Requires-Dist: pylint==3.3.3; extra == 'dev'
Requires-Dist: python-dotenv==1.0.1; extra == 'dev'
Requires-Dist: ruff==0.9.2; extra == 'dev'
Requires-Dist: toml; (python_version <= '3.10') and extra == 'dev'
Requires-Dist: types-pyyaml==6.0.12.20241230; extra == 'dev'
Requires-Dist: types-toml==0.10.8.20240310; extra == 'dev'
Requires-Dist: yamllint==1.35.1; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mdx-include==1.4.2; extra == 'docs'
Requires-Dist: mdx-truly-sane-lists==1.3; extra == 'docs'
Requires-Dist: mkdocs-jupyter==0.25.1; extra == 'docs'
Requires-Dist: mkdocs-macros-plugin==1.3.7; extra == 'docs'
Requires-Dist: mkdocs-material==9.5.50; extra == 'docs'
Requires-Dist: mkdocs-minify-html-plugin==0.2.3; extra == 'docs'
Requires-Dist: mkdocs==1.6.1; extra == 'docs'
Requires-Dist: mkdocstrings-python==1.13.0; extra == 'docs'
Requires-Dist: mkdocstrings[crystal,python]==0.27.0; extra == 'docs'
Provides-Extra: jupyter
Requires-Dist: jupyterlab>=4.3.0; extra == 'jupyter'
Requires-Dist: waldiez-jupyter==0.3.1; extra == 'jupyter'
Provides-Extra: studio
Requires-Dist: waldiez-studio==0.3.1; extra == 'studio'
Provides-Extra: test
Requires-Dist: pytest-asyncio==0.25.2; extra == 'test'
Requires-Dist: pytest-cov==6.0.0; extra == 'test'
Requires-Dist: pytest-html==4.1.1; extra == 'test'
Requires-Dist: pytest-sugar==1.0.0; extra == 'test'
Requires-Dist: pytest-timeout==2.3.1; extra == 'test'
Requires-Dist: pytest-xdist==3.6.1; extra == 'test'
Requires-Dist: pytest==8.3.4; extra == 'test'
Description-Content-Type: text/markdown

# Waldiez

![CI Build](https://github.com/waldiez/python/actions/workflows/main.yaml/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/waldiez/python/badge.svg)](https://coveralls.io/github/waldiez/python) [![PyPI version](https://badge.fury.io/py/waldiez.svg?icon=si%3Apython)](https://badge.fury.io/py/waldiez)

Translate a Waldiez flow:

![Flow](https://raw.githubusercontent.com/waldiez/python/refs/heads/main/docs/static/images/overview.webp)

To a python script or a jupyter notebook with the corresponding [ag2](https://github.com/ag2ai/ag2/) agents and chats.

## Features

- Convert .waldiez flows to .py or .ipynb
- Run a .waldiez flow
- Store the runtime logs of a flow to csv for further analysis

## Installation

On PyPI:

```bash
python -m pip install waldiez
```

From the repository:

```bash
python -m pip install git+https://github.com/waldiez/python.git
```

## Usage

### UI Options

- For creating-only (no exporting or running) waldiez flows, you can use the playground at <https://waldiez.github.io>.
The repo for the js library is [here](https://github.com/waldiez/react).
- There is also a jupyterlab extension [here](https://github.com/waldiez/jupyter)
- You also can use the vscode extension:
  - [repo](https://github.com/waldiez/vscode)
  - [marketplace](https://marketplace.visualstudio.com/items?itemName=Waldiez.waldiez-vscode)
- Finally, you can use [waldiez-studio](https://github.com/waldiez/studio), which includes a FastAPI app to handle the conversion and running of waldiez flows.

The jupyterlab extension and waldiez studio are also provided as extras in the main package.

```shell
pip install waldiez[studio]  # or pip install waldiez_studio
pip install waldiez[jupyter]  # or pip install waldiez_jupyter
# or both
pip install waldiez[studio,jupyter]
```

### CLI

```bash
# Convert a Waldiez flow to a python script or a jupyter notebook
waldiez convert --file /path/to/a/flow.waldiez --output /path/to/an/output/flow[.py|.ipynb]
# Convert and run the script, optionally force generation if the output file already exists
waldiez run --file /path/to/a/flow.waldiez --output /path/to/an/output/flow[.py] [--force]
```

### Using docker/podman

```shell
CONTAINER_COMMAND=docker # or podman
# pull the image
$CONTAINER_COMMAND pull waldiez/waldiez
# Convert a Waldiez flow to a python script or a jupyter notebook
$CONTAINER_COMMAND run \
  --rm \
  -v /path/to/a/flow.waldiez:/flow.waldiez \
  -v /path/to/an/output:/output \
  waldiez/waldiez convert --file /flow.waldiez --output /output/flow[.py|.ipynb] [--force]

# with selinux and/or podman, you might get permission (or file not found) errors, so you can try:
$CONTAINER_COMMAND run \
  --rm \
  -v /path/to/a/flow.waldiez:/flow.waldiez \
  -v /path/to/an/output:/output \
  --userns=keep-id \
  --security-opt label=disable \
  waldiez/waldiez convert --file /flow.waldiez --output /output/flow[.py|.ipynb] [--force]
```

```shell
# Convert and run the script
$CONTAINER_COMMAND run \
  --rm \
  -v /path/to/a/flow.waldiez:/flow.waldiez \
  -v /path/to/an/output:/output \
  waldiez/waldiez run --file /flow.waldiez --output /output/output[.py]
```

### As a library

#### Export a flow

```python
# Export a Waldiez flow to a python script or a jupyter notebook
from waldiez import WaldiezExporter
flow_path = "/path/to/a/flow.waldiez"
output_path = "/path/to/an/output.py"  # or .ipynb
exporter = WaldiezExporter.load(flow_path)
exporter.export(output_path)
```

#### Run a flow

```python
# Run a flow
from waldiez import WaldiezRunner
flow_path = "/path/to/a/flow.waldiez"
output_path = "/path/to/an/output.py"
runner = WaldiezRunner.load(flow_path)
runner.run(output_path=output_path)
```

### Tools

- [ag2 (formerly AutoGen)](https://github.com/ag2ai/ag2)
- [juptytext](https://github.com/mwouts/jupytext)
- [pydantic](https://github.com/pydantic/pydantic)
- [typer](https://github.com/fastapi/typer)
- [asyncer](https://github.com/fastapi/asyncer)

## Known Conflicts

- **autogen-agentchat**: This package conflicts with `ag2` / `pyautogen`. Ensure that `autogen-agentchat` is uninstalled before installing `waldiez`. If you have already installed `autogen-agentchat`, you can uninstall it with the following command:

  ```shell
  pip uninstall autogen-agentchat -y
  ```

  If already installed waldiez you might need to reinstall it after uninstalling `autogen-agentchat`:

  ```shell
  pip install --force --no-cache waldiez pyautogen
  ```

## License

This project is licensed under the [Apache License, Version 2.0 (Apache-2.0)](https://github.com/waldiez/python/blob/main/LICENSE).
