π Hunch
A fast, offline media filename parser for Rust β extract title, year, season, episode, codec, language, and 49 properties from messy filenames.
Hunch is a Rust rewrite of Python's guessit. Pure, deterministic, single-binary, linear-time regex only (ReDoS-immune).
Quick Start
# Install
CLI
{
}
Library
use hunch;
Cross-file context
For CJK, anime, or ambiguous filenames, hunch uses sibling files and directory names as context for better title extraction and type detection.
# Single file with sibling context:
# Batch-parse a single directory:
# Batch-parse an entire media library (recommended):
π‘ Tip: Always use
--batch -rfrom your library root (e.g.,tv/,movies/) rather than running--batchon each leaf directory individually. The-rflag preserves full relative paths liketv/Anime/Show/Extra/Menu.mkv, giving the parser critical context from directory names (tv/,Anime/,Season 1/) for accurate type detection. Without-r, files in deep subdirectories lose their path context and bonus content (SP, OVA, NCED) may be misclassified.
Documentation
| Document | Audience | Content |
|---|---|---|
| User Manual | Users | Install, CLI, library API, all 49 properties, FAQ |
| Design | Contributors | Principles, architecture, key decisions |
| Compatibility | Everyone | guessit test suite pass rates by property |
| API Reference | Developers | Full Rust API docs |
| Changelog | Everyone | Version history |
guessit Compatibility
All 49 guessit properties implemented. Validated against guessit's 1,309-case test suite.
| Metric | Value |
|---|---|
| Pass rate | 81.8% (1,071 / 1,309) |
| Properties at 95%+ | 22 |
| Properties at 100% | 16 |
See docs/compatibility.md for per-property breakdowns.
Contributing
See CONTRIBUTING.md. The easiest contribution is reporting a failed parse.