Metadata-Version: 2.4
Name: estravon-backend
Version: 0.1.5
Summary: Self-hosted PDF extraction backend for the Estravon Zotero plugin
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: python-fasthtml<1.0,>=0.12.0
Requires-Dist: replicate<2.0,>=0.34.0
Requires-Dist: httpx<1.0,>=0.27.0
Requires-Dist: python-multipart<1.0,>=0.0.9
Requires-Dist: python-dotenv<2.0,>=1.0.0
Requires-Dist: pypdf[cryptography]>=4.0
Requires-Dist: mistralai<3.0,>=2.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Provides-Extra: nlp
Requires-Dist: spacy>=3.7; extra == "nlp"
Dynamic: license-file

# estravon-backend

Self-hosted PDF extraction backend for the
[Estravon Zotero plugin](https://github.com/tiberavonltd/estravon-plugin).

> **Independent project.**
> Estravon is not affiliated with, endorsed by, or in any way connected to the
> [Zotero project](https://www.zotero.org/) or the Corporation for Digital Scholarship.
> Zotero is a registered trademark of the Corporation for Digital Scholarship.

---

Extracts nominated sections of a book PDF to Markdown and attaches the result
directly to the Zotero item — synced, versioned, always co-located with the source.
The plugin handles everything Zotero-side; this package runs on your machine and
owns the extraction pipeline.

## Installation

```bash
pip install estravon-backend
```

Requires Python 3.11+.

## Quick start

```bash
# 1. Create a .env file with your API key
echo "MISTRAL_API_KEY=your_key_here" > .env

# 2. Start the backend
estravon --port 7766
```

In Zotero → Settings → Estravon, confirm the status indicator is green,
then right-click any item with a PDF → **Extract Section to Markdown…**

Full setup guide: [estravon.com/install](https://estravon.com/install)

## Supported extraction backends

| Backend | Pricing | How to use |
|---|---|---|
| [Mistral OCR](https://console.mistral.ai/) | ~$0.002/page, pay-as-you-go | Default. Set `MISTRAL_API_KEY` in `.env`. |
| [Datalab](https://www.datalab.to/) | $25/month flat | Set `DATALAB_API_KEY` and `_ZM_BACKEND=datalab`. |
| [Replicate](https://replicate.com/) | Pay-as-you-go | Set `REPLICATE_API_TOKEN` and `_ZM_BACKEND=replicate`. |

## Links

- [Plugin repository](https://github.com/tiberavonltd/estravon-plugin)
- [Full documentation](https://github.com/tiberavonltd/estravon-backend#readme)
- [estravon.com](https://estravon.com)
- [Report an issue](https://github.com/tiberavonltd/estravon-backend/issues)

## License

[AGPL-3.0](https://www.gnu.org/licenses/agpl-3.0.html) — the same license as Zotero itself.
