Metadata-Version: 2.5
Name: agentbuild
Version: 0.0.2
Summary: Tools to make agent research easier.
Author: trducng
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Requires-Dist: ipython>=8
Description-Content-Type: text/markdown

# agentbuild

Tools to make agent research easier.

## Install

```bash
pip install agentbuild
```

## Jupyter: `%load_cells`

Copy the code of cells from another notebook into the current cell, the way `%load` does for
files.

```python
%load_ext agentbuild.jupyter

%load_cells other.ipynb                            # list the notebook's cells, IDs and titles
%load_cells other.ipynb --cells 7f3a9c21 b2e4d0aa  # copy those cells into this cell
%load_cells "my export.ipynb" -c "Import Libraries" 7f3a
%load_cells other.ipynb -c 7f3a9c21 --run          # run those cells instead of copying them
%load_cells other.ipynb -c 7f3a9c21 --print        # print their code instead of copying it
```

Each cell after `--cells` (or `-c`) can be:

- a cell ID: the Jupyter cell ID, or for notebooks exported from Databricks, the Databricks cell ID
  (`nuid`);
- the start of a cell ID, such as the 8 characters the listing shows;
- a Databricks cell title, matched exactly or ignoring case. Quote titles that contain spaces.

If a value matches more than one cell, the magic stops with an error instead of guessing.

Running the magic with `--cells` replaces the current cell with a commented-out copy of the magic
line, followed by the code of the chosen cells in the order given. Run the cell again to execute
that code. Relative paths are resolved from the kernel's working directory, which is normally the
notebook's folder.

- `--run` runs the chosen cells' code in the current session instead of copying it. Magics in
  that code, such as `%pip`, work as they would in a cell.
- `--print` prints the code instead of replacing the current cell, for notebook apps that can't
  replace a cell's contents. This is the default on Databricks, whose notebooks can't (it's
  detected through the `DATABRICKS_RUNTIME_VERSION` environment variable).

To load the extension in every session, add this to
`~/.ipython/profile_default/ipython_config.py`:

```python
c.InteractiveShellApp.extensions = ["agentbuild.jupyter"]
```

## Development

Requires [uv](https://docs.astral.sh/uv/) and `make`.

```bash
make install       # install the package + dev tools, set up git hooks
make help          # list all commands
```

Common commands:

```bash
make test          # run tests
make test-matrix   # run tests on Python 3.11-3.15 (override with PYTHONS="3.11 3.12")
make cov           # run tests with a coverage report
make lint          # lint + format check
make format        # auto-fix lint issues and format
make check         # run the same checks as CI
```

## Release

```bash
make publish       # build and upload to PyPI (needs a PyPI token)
```
