Metadata-Version: 2.4
Name: hedit
Version: 0.7.6.dev5
Summary: Multi-agent system for HED annotation generation and validation
Author-email: Annotation Garden Initiative <info@annotation.garden>
License-Expression: MIT
Project-URL: Homepage, https://annotation.garden/hedit
Project-URL: Documentation, https://docs.annotation.garden/hedit
Project-URL: Repository, https://github.com/Annotation-Garden/hedit
Project-URL: Issues, https://github.com/Annotation-Garden/hedit/issues
Keywords: hed,annotation,neuroscience,bids,cli
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.20.0
Requires-Dist: rich>=14.0.0
Requires-Dist: platformdirs>=4.5.0
Requires-Dist: pyyaml>=6.0.2
Requires-Dist: httpx>=0.28.0
Requires-Dist: pydantic>=2.12.0
Provides-Extra: standalone
Requires-Dist: langgraph>=0.2.0; extra == "standalone"
Requires-Dist: langchain>=0.3.0; extra == "standalone"
Requires-Dist: langchain-community>=0.3.0; extra == "standalone"
Requires-Dist: langchain-core>=0.3.0; extra == "standalone"
Requires-Dist: langchain-openai>=0.3.0; extra == "standalone"
Requires-Dist: litellm>=1.50.0; extra == "standalone"
Requires-Dist: langchain-litellm>=0.2.0; extra == "standalone"
Requires-Dist: hedtools>=0.5.0; extra == "standalone"
Requires-Dist: lxml>=5.3.0; extra == "standalone"
Requires-Dist: beautifulsoup4>=4.12.3; extra == "standalone"
Requires-Dist: pillow>=11.0.0; extra == "standalone"
Requires-Dist: nest-asyncio>=1.6.0; extra == "standalone"
Provides-Extra: api
Requires-Dist: hedit[standalone]; extra == "api"
Requires-Dist: fastapi>=0.121.0; extra == "api"
Requires-Dist: uvicorn[standard]>=0.38.0; extra == "api"
Requires-Dist: python-multipart>=0.0.17; extra == "api"
Requires-Dist: aiofiles>=25.1.0; extra == "api"
Requires-Dist: python-dotenv>=1.0.0; extra == "api"
Provides-Extra: dev
Requires-Dist: hedit[api]; extra == "dev"
Requires-Dist: pytest>=8.3.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.24.0; extra == "dev"
Requires-Dist: ruff>=0.7.0; extra == "dev"
Requires-Dist: black>=24.8.0; extra == "dev"
Requires-Dist: mypy>=1.11.0; extra == "dev"
Provides-Extra: all
Requires-Dist: hedit[api,dev]; extra == "all"
Dynamic: license-file

# HEDit

[![PyPI version](https://badge.fury.io/py/hedit.svg)](https://pypi.org/project/hedit/)
[![Tests](https://github.com/Annotation-Garden/hedit/actions/workflows/test.yml/badge.svg)](https://github.com/Annotation-Garden/hedit/actions/workflows/test.yml)

Convert natural language event descriptions into valid [HED](https://hedtags.org) (Hierarchical Event Descriptors) annotations.

Part of the [Annotation Garden Initiative](https://annotation.garden).

## Installation

```bash
# Default (lightweight API client, ~100MB)
pip install hedit

# Standalone mode (run locally without backend, ~2GB)
pip install hedit[standalone]
```

## Quick Start

```bash
# Configure your OpenRouter API key (https://openrouter.ai)
hedit init --api-key sk-or-v1-xxx

# Generate HED annotation from text
hedit annotate "participant pressed the left button"

# Generate HED from an image
hedit annotate-image stimulus.png

# Validate a HED string
hedit validate "Sensory-event, Visual-presentation"
```

## Commands

| Command | Description |
|---------|-------------|
| `hedit init` | Configure API key and preferences |
| `hedit annotate "text"` | Convert natural language to HED |
| `hedit annotate-image <file>` | Generate HED from image |
| `hedit validate "HED-string"` | Validate HED annotation |
| `hedit health` | Check service status |
| `hedit config show` | Display configuration |

## Options

```bash
hedit annotate "text" -o json          # JSON output for scripting
hedit annotate "text" --schema 8.3.0   # Specific HED schema version
hedit annotate "text" --standalone     # Run locally (requires hedit[standalone])
```

## How It Works

HEDit uses a multi-agent system (LangGraph) with feedback loops:

1. **Annotation Agent** - Generates initial HED tags
2. **Validation Agent** - Checks syntax and tag validity
3. **Evaluation Agent** - Assesses faithfulness to input
4. **Assessment Agent** - Identifies missing elements

Annotations are automatically refined until validation passes.

## Links

- [Documentation](https://docs.annotation.garden/hedit)
- [GitHub Repository](https://github.com/Annotation-Garden/HEDit)
- [HED Standard](https://hedtags.org)
- [OpenRouter](https://openrouter.ai) - Get an API key

## License

MIT
