Skip to main content

Anime video filename parser (Python bindings for the anitomy-ng Rust crate)

Project description

anitomy-ng

CI crates.io docs.rs PyPI npm NuGet License: MPL 2.0

A pure-Rust port of erengy/anitomy, an anime video filename parser, with Python, JavaScript, and .NET bindings. The core library is pure safe Rust — 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:

cargo add anitomy-ng

Python (wheels built via maturin):

pip install anitomy-ng

JavaScript / TypeScript (WebAssembly, works in Node and bundlers):

npm install anitomy-ng

Command line — prebuilt binaries for Linux, macOS, and Windows are attached to each GitHub release. Download one directly, or install with either:

cargo binstall anitomy-ng               # prebuilt binary, no toolchain needed
cargo install anitomy-ng --features cli # builds from source

.NET (prebuilt native binaries ship in the package — no Rust toolchain needed):

dotnet add package AnitomyNg

Usage

Rust:

let elements = anitomy_ng::parse(
    "[TaigaSubs]_Toradora!_(2008)_-_01v2_-_Tiger_and_Dragon_[1280x720_H.264_FLAC][1234ABCD].mkv",
    anitomy_ng::Options::default(),
);
for element in &elements {
    println!("{:?}: {}", element.kind, element.value);
}

Python:

import anitomy_ng

for element in anitomy_ng.parse(
    "[TaigaSubs]_Toradora!_(2008)_-_01v2_-_Tiger_and_Dragon_[1280x720_H.264_FLAC][1234ABCD].mkv"
):
    print(element.kind, element.value)

JavaScript / TypeScript:

import { parse } from "anitomy-ng";

for (const element of parse(
  "[TaigaSubs]_Toradora!_(2008)_-_01v2_-_Tiger_and_Dragon_[1280x720_H.264_FLAC][1234ABCD].mkv",
)) {
  console.log(element.kind, element.value);
}

C# / .NET:

using AnitomyNg;

foreach (var element in Anitomy.Parse(
    "[TaigaSubs]_Toradora!_(2008)_-_01v2_-_Tiger_and_Dragon_[1280x720_H.264_FLAC][1234ABCD].mkv"))
{
    Console.WriteLine($"{element.Kind}: {element.Value}");
}

They all 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.

Command line (anitomy) — takes filenames as arguments or reads them from stdin (one per line), and prints an aligned table or, with --json, an array of { filename, elements }:

anitomy '[TaigaSubs]_Toradora!_(2008)_-_01v2_-_Tiger_and_Dragon_[1280x720_H.264_FLAC][1234ABCD].mkv'
ls *.mkv | anitomy --json

Pass --no-title, --no-episode, etc. to disable individual categories; see anitomy --help.

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
anitomy-js/    JavaScript/TypeScript bindings (wasm-bindgen, published to npm as `anitomy-ng`)
anitomy-c/     C ABI (cdylib/staticlib) over the core — the only crate with `unsafe`;
               the foundation for non-Rust bindings
bindings/csharp/  .NET bindings (P/Invoke over anitomy-c, published to NuGet as `AnitomyNg`)
third_party/   vendored upstream test fixtures, not compiled — see third_party/README.md
scripts/       fixture-generation tooling

Development

cargo test -p anitomy-ng --test conformance     # Rust conformance suite
cd anitomy-py && uv run --extra test pytest tests/ -q   # Python conformance suite

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anitomy_ng-1.0.2.tar.gz (115.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

anitomy_ng-1.0.2-cp39-abi3-win_amd64.whl (419.6 kB view details)

Uploaded CPython 3.9+Windows x86-64

anitomy_ng-1.0.2-cp39-abi3-win32.whl (387.9 kB view details)

Uploaded CPython 3.9+Windows x86

anitomy_ng-1.0.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (590.7 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

anitomy_ng-1.0.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (581.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

anitomy_ng-1.0.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.0 MB view details)

Uploaded CPython 3.9+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file anitomy_ng-1.0.2.tar.gz.

File metadata

  • Download URL: anitomy_ng-1.0.2.tar.gz
  • Upload date:
  • Size: 115.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anitomy_ng-1.0.2.tar.gz
Algorithm Hash digest
SHA256 491016d97bfbe780e1149bc9f4223b473a86568be112efc6063f9b692d6458cd
MD5 a0f12fd14f1103f702809ef471abf333
BLAKE2b-256 8c0dc107f0227e110fd3d4a1e0ad0c4efa313c0f47fe3d812a7c387fba709b9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for anitomy_ng-1.0.2.tar.gz:

Publisher: release.yml on tylergibbs2/anitomy-ng

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anitomy_ng-1.0.2-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: anitomy_ng-1.0.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 419.6 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anitomy_ng-1.0.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6b2336a25c5348946a80586e9b232ad591d00d5bd311f5d1602ba9b0b54bd018
MD5 f8cbdc62598dcd1befdc3f21d019b7e3
BLAKE2b-256 bf510d0ff984e17d76cce089e5a9eafd495247ad35e807a557720cdd3a3d12f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for anitomy_ng-1.0.2-cp39-abi3-win_amd64.whl:

Publisher: release.yml on tylergibbs2/anitomy-ng

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anitomy_ng-1.0.2-cp39-abi3-win32.whl.

File metadata

  • Download URL: anitomy_ng-1.0.2-cp39-abi3-win32.whl
  • Upload date:
  • Size: 387.9 kB
  • Tags: CPython 3.9+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anitomy_ng-1.0.2-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 28609fb696d999439aa0d64909caa3f447b9315c3f608b307790b28f84e61a1a
MD5 9a54383f0b9a99a066f3285b95d0138f
BLAKE2b-256 80df49704722601dd17044725e399624cd01726000a17d42db8e966885bafaa4

See more details on using hashes here.

Provenance

The following attestation bundles were made for anitomy_ng-1.0.2-cp39-abi3-win32.whl:

Publisher: release.yml on tylergibbs2/anitomy-ng

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anitomy_ng-1.0.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for anitomy_ng-1.0.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c30ccd97dc18e8461946831ff33f83ee6b5baea819ce7c4bcd5927faacc1c649
MD5 8370b4a8bc5abf607c7c0e612c495d64
BLAKE2b-256 1305cd362e6940f56d94374ce210570846d7b07bcafbc6b7f088788a057a6814

See more details on using hashes here.

Provenance

The following attestation bundles were made for anitomy_ng-1.0.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on tylergibbs2/anitomy-ng

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anitomy_ng-1.0.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for anitomy_ng-1.0.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 81341725d02dad9336753fb07b0ca45154d4813427d53ab0a219d9e0862d47b7
MD5 0ad6b09c84e4ba810fd2a3193bd9555b
BLAKE2b-256 5980bddd4ce1af277d9f1801381b9c83f49780949932aa7b0d18a882bd467c3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for anitomy_ng-1.0.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on tylergibbs2/anitomy-ng

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anitomy_ng-1.0.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for anitomy_ng-1.0.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 30eeb2be2d26be1aee446ce3a21302c4c0b55c82d04725e7dceaee1fc069df21
MD5 2a965e539dce8ada48ea8fe8823fbef8
BLAKE2b-256 9f7820618e3c8f9eac70a7a66c88605f14bfa9f21f99ac8679a1e97dbcbd6dc5

See more details on using hashes here.

Provenance

The following attestation bundles were made for anitomy_ng-1.0.2-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release.yml on tylergibbs2/anitomy-ng

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page