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.3.tar.gz (117.3 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.3-cp39-abi3-win_amd64.whl (419.7 kB view details)

Uploaded CPython 3.9+Windows x86-64

anitomy_ng-1.0.3-cp39-abi3-win32.whl (388.6 kB view details)

Uploaded CPython 3.9+Windows x86

anitomy_ng-1.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (591.2 kB view details)

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

anitomy_ng-1.0.3-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.3-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.3.tar.gz.

File metadata

  • Download URL: anitomy_ng-1.0.3.tar.gz
  • Upload date:
  • Size: 117.3 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.3.tar.gz
Algorithm Hash digest
SHA256 2e8e693f79de735c555348faa5bb83c50d1e31b8d0736e2a26331bc177c175da
MD5 67e4c752099a5211702fdf1c52aae259
BLAKE2b-256 097bf0606b4e5beb3322e0ba2c29783bee39df8151bd2001200d6166ae4d6280

See more details on using hashes here.

Provenance

The following attestation bundles were made for anitomy_ng-1.0.3.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.3-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: anitomy_ng-1.0.3-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 419.7 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.3-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f2a34a4eff29e0c1be13b2a79cac6ce85d39e8e6508c7eafff0d1500fd72a452
MD5 6e138a2c5bdc2e25b559330690f6549a
BLAKE2b-256 8297ae730e68a12e372795cdcfbcc4197d712923b1a4f45826e56d30297586a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for anitomy_ng-1.0.3-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.3-cp39-abi3-win32.whl.

File metadata

  • Download URL: anitomy_ng-1.0.3-cp39-abi3-win32.whl
  • Upload date:
  • Size: 388.6 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.3-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 73c06ccb97047bba456ba12025238f8fc538f888584f61defc3973ef8002b6e0
MD5 55917df5a9535a54bf27512bfaa1c3ab
BLAKE2b-256 d51997d654103d50a2964afb65b907c2344743a4bc0d658d51f96ee788623cac

See more details on using hashes here.

Provenance

The following attestation bundles were made for anitomy_ng-1.0.3-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.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for anitomy_ng-1.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 455dd9691f2ae42d6540439b8617885a9a7aba67c597e6c1e738ce5c90a11b9a
MD5 df013c8ce3673392b42704a4c3355ce4
BLAKE2b-256 56280feacc77170352dc7ac7f79498ee50dffa8f65c882091ad9c5fbfc0eb1ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for anitomy_ng-1.0.3-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.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for anitomy_ng-1.0.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c08e0c61514cdb97be3c334c4f52082871b8e06ae8913b551f33fda3606b62ce
MD5 8f553788f1402f8a7b66176c52a73c6f
BLAKE2b-256 3c6d6f11aad8bfaca29a26aa0b720513d959c59d6e65d6ab5d89169c75bacfa4

See more details on using hashes here.

Provenance

The following attestation bundles were made for anitomy_ng-1.0.3-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.3-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.3-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 8f64ad07ad0b287f2737501b6c7b0ce341b3cdf5cfa836825b178e8ebb294779
MD5 a319f3a04643d691825431a6e3c72d57
BLAKE2b-256 8d079d6e9c8adaf633445996085eda0d5a0dc18cca72af7a9fd8cb71f3f3fd23

See more details on using hashes here.

Provenance

The following attestation bundles were made for anitomy_ng-1.0.3-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