Metadata-Version: 2.4
Name: sidx
Version: 0.0.2
Summary: A multi-stage agentic framework for extracting structured data from documents
Keywords: llm,agents,data-extraction,document-extraction,pydantic-ai,docling
Author: Andy Tseng
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Dist: docling>=2.151.1
Requires-Dist: pydantic-ai>=2.71.0
Requires-Python: >=3.13
Project-URL: Homepage, https://github.com/ohandyya/self-improving-data-extraction
Project-URL: Repository, https://github.com/ohandyya/self-improving-data-extraction
Description-Content-Type: text/markdown

# sidx

**S**elf-**i**mproving **d**ata e**x**traction: a multi-stage agentic framework
for extracting structured data from documents, built on
[PydanticAI](https://ai.pydantic.dev) and
[Docling](https://github.com/docling-project/docling).

> **Work in progress.** There is no extraction code yet. The design is being
> written in [`docs/design/`](./docs/design/).

The first source documents are 401(k) basic plan documents from three
providers. Each one lays out the same material differently, which makes them
a test of whether extraction holds up across layouts. See
[`resources/plan_documents/`](./resources/plan_documents/README.md).

## Setup

Requires [uv](https://docs.astral.sh/uv/). Python 3.13 is installed by uv if
you don't have it.

```sh
uv sync                                       # install dependencies into .venv
make hooks                                    # install the pre-commit hook, once per clone
uv run python scripts/download_plan_documents.py   # fetch the source PDFs
```

The source PDFs are copyrighted by their publishers, so they are not committed
here. The download script fetches each one from its original URL and checks it
against a pinned SHA-256.

To call a model, copy `.env.example` to `.env` and fill in the values. Each
variable is described in `.env.example`.

## Development

```sh
make help        # list every target
make check-all   # ruff lint, ruff format check, pyright — what CI runs
make fix         # auto-fix lint errors
make format      # reformat code
```

[`CONTRIBUTING.md`](./CONTRIBUTING.md) covers the PR checklist and how releases
are published to PyPI.

| Path | What's there |
|---|---|
| `src/sidx/` | The package (`import sidx`) |
| `scripts/` | One-off tooling, such as the PDF download script |
| `resources/plan_documents/` | Source documents (downloaded, not committed) and notes on them |
| `docs/design/` | How the system is meant to work — the spec |
| `docs/implementations/` | The build plan, one doc per PR |

## Cutting a release

Releases are published to PyPI by GitHub Actions, never from a laptop.

1. **Check you're ready.** From an up-to-date `main` with a clean working tree:

   ```sh
   git switch main && git pull
   make release-check                 # add VERSION=X.Y.Z to check that version is free
   ```

   It changes nothing. Fix any `FAIL` line before going on.

2. **Run the release.** In Claude Code, run `/create-new-release`. It proposes
   the next version for you to confirm, merges a release PR with the version
   bump and changelog, tags it, publishes the GitHub release, and checks that
   PyPI has the new version.

The one-time PyPI and GitHub setup, and how to release by hand, are in
[`CONTRIBUTING.md`](./CONTRIBUTING.md#releasing).

## License

[MIT](./LICENSE), covering the code and docs in this repo. The plan document
PDFs belong to their respective publishers and are not covered by it.
