Metadata-Version: 2.4
Name: beetea
Version: 0.1.0
Summary: Reactive behavior trees with optional ROS 2 transport support
Author-email: Kaj Munhoz Arfvidsson <kajarf@kth.se>
Maintainer-email: Kaj Munhoz Arfvidsson <kajarf@kth.se>
Keywords: behavior-tree,robotics,ros2
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Provides-Extra: test
Requires-Dist: pytest>=8; extra == "test"
Provides-Extra: release
Requires-Dist: build>=1.2; extra == "release"
Requires-Dist: twine>=6; extra == "release"

# BeeTea

BeeTea is a small Python library for reactive behavior trees. It provides
composable conditions, asynchronous actions, sequences, fallbacks, subtree
replacement, status observation, and optional ROS 2 transport adapters.

## Installation

Install the core behavior-tree library from PyPI:

```console
python -m pip install beetea
```

The core package has no runtime dependencies. The `beetea.ros` module is
optional and expects `rclpy`, `std_srvs`, `beetea_msgs`, and `svea_core` to be
installed in the ROS 2 environment.

## Quick start

```python
from beetea import Action, BehaviorTree, Condition, Sequence

ready = True

tree = BehaviorTree(
    Sequence(
        (
            Condition(lambda: ready, label="ready"),
            Action(lambda: print("Working"), label="work"),
        )
    )
)

response = tree.tick()
```

`Action` callables run asynchronously, so an action normally returns
`RUNNING` on its first tick and publishes its terminal status when the callable
finishes. Call `tree.halt()` when the tree should become inactive.

Trees can also be parsed from the indented text format:

```python
from beetea import Action, Condition, parse_bt

root = parse_bt(
    """\
sequence #mission
  $ready
  $work
""",
    {
        "ready": lambda: Condition(lambda: True),
        "work": lambda: Action(lambda: None),
    },
)
```

## Development

Run the dependency-free core test suite with:

```console
python -m unittest beetea.tests.test_bt
```

The ROS adapter tests additionally require the `svea_core` package to be
importable. To build and validate release artifacts:

```console
python -m build
python -m twine check dist/*
```

## License

A license has not yet been selected. Choose a license and add its text before
publishing the package.
