Metadata-Version: 2.4
Name: flytie
Version: 0.2.1
Summary: A CLI for managing, versioning, and exporting fly tying patterns.
Project-URL: Homepage, https://github.com/finngidden/flytie
Project-URL: Documentation, https://github.com/finngidden/flytie#readme
Project-URL: Changelog, https://github.com/finngidden/flytie/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/finngidden/flytie/issues
Author-email: Finn Gidden <finn.gidden@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: cli,fly-fishing,fly-tying,patterns
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Requires-Dist: alembic<2.0,>=1.13
Requires-Dist: jinja2<4.0,>=3.1
Requires-Dist: platformdirs<5.0,>=4.2
Requires-Dist: pydantic<3.0,>=2.7
Requires-Dist: rich<15.0,>=13.7
Requires-Dist: sqlalchemy<3.0,>=2.0
Requires-Dist: tomli-w<2.0,>=1.0
Requires-Dist: tomli<3.0,>=2.0; python_version < '3.11'
Requires-Dist: typer<1.0,>=0.12
Provides-Extra: ai
Requires-Dist: anthropic<1.0,>=0.30; extra == 'ai'
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pdfminer-six>=20221105; extra == 'dev'
Requires-Dist: pre-commit>=3.5; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.2; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Requires-Dist: syrupy>=4.6; extra == 'dev'
Provides-Extra: pdf
Requires-Dist: weasyprint<70.0,>=61.0; extra == 'pdf'
Description-Content-Type: text/markdown

# flytie — Fly Tying Recipe Manager

A local-first, AI-augmented command-line tool for managing fly tying patterns.
Tag and search your patterns, track every tweak with automatic versioning,
generate trip-ready deduplicated shopping lists, export printable pattern
cards, and ask Claude for recommendations grounded in your own library.

Everything lives in a single local SQLite file — no account, no server, and no
network access unless you explicitly run `flytie suggest`.

## What it does

- **Manage patterns** — add, list, view, search, tag, edit, delete, and
  undelete tying patterns with structured hook sizes, materials, target
  species, and notes.
- **Version automatically** — every edit creates an immutable version; list
  the history, diff any two versions, and restore an old one. Diffs sort
  materials alphabetically so reordering alone produces no noise.
- **Library stats** — `flytie stats` shows an overview, top-5 rankings, and
  timeline info for your library at a glance.
- **Clean up materials** — `flytie material merge` rewrites all references
  from one material name to another, eliminating duplicates across your
  entire version history. `flytie material dedupe` scans for likely
  duplicates using fuzzy matching and walks you through merging them.
- **Plan trips** — aggregate materials across any set of patterns into one
  deduplicated shopping list, excluding what you already own.
- **Export cards** — render a styled pattern card to PDF (or HTML).
- **Get suggestions** — `flytie suggest` asks the Anthropic Claude API for
  flies suited to a species, season, and water, grounded in your library.
- **Stay portable** — export and import your whole library as documented JSON.

## Install

```bash
pip install flytie               # core CLI + styled HTML pattern cards
pip install "flytie[pdf]"        # + PDF export (needs the native libs below)
pip install "flytie[ai]"         # + AI suggestions
pip install "flytie[pdf,ai]"     # everything
```

The core install includes Jinja2, so `flytie export <name> --html` produces a
styled, printable HTML pattern card on a bare `pip install flytie` — no
extras, no native libraries. Any browser can open and print the resulting
file. Choose the `[pdf]` extra only when you specifically want PDF output.

### PDF export native dependencies

The `[pdf]` extra installs WeasyPrint, which depends on the native Pango /
Cairo / GdkPixbuf libraries. These are **not** Python packages and must be
installed at the OS level:

```bash
# macOS
brew install pango

# Debian / Ubuntu
sudo apt install libpango-1.0-0 libpangoft2-1.0-0

# Fedora / RHEL
sudo dnf install pango

# Windows
# See https://doc.courtbouillon.org/weasyprint/stable/first_steps.html
```

If installing the native libraries isn't an option on your platform, stick
with the core install and use `flytie export <name> --html` for printable
output.

**macOS note:** install Pango via Homebrew (`brew install pango`) *before*
running `pip install "flytie[pdf]"`. On some macOS + Python combinations
(notably Python installed via Anaconda when Homebrew's Pango is also
present), importing WeasyPrint without a matching native Pango can
SIGSEGV the interpreter rather than raise a clean `ImportError`. Running
`brew install pango` first avoids the binary incompatibility.

## 60-second example

```bash
flytie init
flytie add "Parachute Adams" --hook 14 --tag dry \
  --material "grizzly hackle,hackle,1,feather"
flytie shop --tag dry                              # deduped shopping list
flytie export "Parachute Adams" --out ~/cards/     # printable PDF card
```

## Documentation

Full guides live in [`docs/`](docs/index.md):

- [Quickstart](docs/quickstart.md) — install and your first pattern
- [Command reference](docs/commands.md) — every command and option
- [Shopping list cookbook](docs/shopping-list.md)
- [AI suggestions](docs/ai-suggestions.md)
- [Migrating from a notebook](docs/migrating-from-notebook.md)
- [Export JSON schema](docs/json-schema.md)

Every command also has built-in help: `flytie <command> --help`.

## Project status

Current release: `0.2.1`. See [`CHANGELOG.md`](CHANGELOG.md) for the full
release history.

## Development

```bash
pip install -e ".[dev,pdf,ai]"
pre-commit install --hook-type pre-commit --hook-type pre-push
pytest
ruff check src tests
mypy src
```

See [`CONTRIBUTING.md`](CONTRIBUTING.md) for what runs at each hook stage,
how to enable pre-commit.ci, and the formatter / coverage / smoke-test
contracts.

## License

MIT — see [`LICENSE`](LICENSE).
