anitomy-ng
A pure-Rust port of erengy/anitomy, an
anime video filename parser, with Python bindings. No unsafe, no C
dependencies.
[TaigaSubs]_Toradora!_(2008)_-_01v2_-_Tiger_and_Dragon_[1280x720_H.264_FLAC][1234ABCD].mkv
parses into release group, title, year, episode, resolution, video/audio codec, release version, and file checksum — see the examples below.
Status: conformance-tested against upstream's own bundled test data (the
current C++ rewrite on the develop branch and the original, long-frozen
master implementation), plus the
anitopy Python port's fixtures. On
each suite it scores at least as high as that suite's reference parser, run
as a compiled/installed binary rather than judged from its source.
Install
Rust:
Python (wheels built via maturin):
Usage
Rust:
let elements = parse;
for element in &elements
Python:
Both return an ordered list of elements (position in the filename, kind, and
value); ElementKind/kind covers title, episode, season, release group,
video/audio terms, resolution, checksum, and so on — see
anitomy/src/element.rs for the full set.
Layout
anitomy/ core Rust crate (published as `anitomy-ng`) — no unsafe, no non-dev dependencies
anitomy-py/ Python bindings (pyo3 + maturin, published as `anitomy-ng`), typed:
ElementKind is a real enum.Enum, Element a real dataclass
third_party/ vendored upstream test fixtures, not compiled — see third_party/README.md
scripts/ fixture-generation tooling
Development
&&
License
Licensed under the Mozilla Public License 2.0 — see LICENSE.
This project builds on the following, all MPL-2.0, and is distributed under the same license accordingly:
- erengy/anitomy (© Eren Okka) — the C++ implementation this project is a port of.
- Rapptz/anitomy-rs (© Rapptz) — an independent Rust reimplementation; some logic and beyond-upstream keywords are adapted from it.
- igorcmoura/anitopy (© Igor C.
Moura) — its test data (
table.py/failing_table.py) is used as a conformance fixture suite.
third_party/ vendors this upstream material under their own MPL-2.0
licenses — see third_party/README.md.