#anime #filenames #parser #api-bindings

anitomy

Wrapper for Anitomy, the library for parsing anime video filenames

4 releases

Uses old Rust 2015

0.2.0 Nov 17, 2023
0.1.2 Dec 30, 2018
0.1.1 Jun 17, 2018
0.1.0 Jun 17, 2018

#817 in Parser implementations

Download history 9/week @ 2023-12-11 4/week @ 2023-12-18 19/week @ 2024-01-01 14/week @ 2024-01-15 18/week @ 2024-01-22 3/week @ 2024-02-12 52/week @ 2024-02-19 27/week @ 2024-02-26 17/week @ 2024-03-04 19/week @ 2024-03-11 11/week @ 2024-03-18 8/week @ 2024-03-25

59 downloads per month

MPL-2.0 license

22KB
353 lines

rust-anitomy

crates.io docs.rs Linux & OSX Build Status License
rust-anitomy is a Rust binding for Anitomy a C++ library for parsing anime video filenames.

Installation

Add this to your Cargo.toml:

[dependencies]
anitomy = "0.2"

Requirements

As this crate depends on anitomy-sys it's requirements also apply, see Xtansia/rust-anitomy-sys for information about anitomy-sys.

Example

extern crate anitomy;

use anitomy::{Anitomy, ElementCategory};

fn main() {
    let mut anitomy = Anitomy::new();
    match anitomy.parse("[TaigaSubs]_Toradora!_(2008)_-_01v2_-_Tiger_and_Dragon_[1280x720_H.264_FLAC][1234ABCD].mkv") {
    Ok(ref elements) => {
        println!("SUCCESS: Parsed the filename successfully!");
        println!(
            "It is: {} #{} by {}", 
            elements.get(ElementCategory::AnimeTitle).expect("anime title"), 
            elements.get(ElementCategory::EpisodeNumber).expect("episode number"), 
            elements.get(ElementCategory::ReleaseGroup).expect("release group")
        );
        println!("And extracted the following elements: {:#?}", &**elements);
    },
    Err(ref elements) => {
        println!("ERROR: Couldn't parse the filename successfully!");
        println!("But we managed to extract these elements: {:#?}", &**elements);
    },
  }
}

Which outputs:

SUCCESS: Parsed the filename successfully!
It is: Toradora! #01 by TaigaSubs
And extracted the following elements: [
    Element {
        category: FileExtension,
        value: "mkv"
    },
    Element {
        category: FileName,
        value: "[TaigaSubs]_Toradora!_(2008)_-_01v2_-_Tiger_and_Dragon_[1280x720_H.264_FLAC][1234ABCD]"
    },
    Element {
        category: VideoTerm,
        value: "H.264"
    },
    Element {
        category: VideoResolution,
        value: "1280x720"
    },
    Element {
        category: AudioTerm,
        value: "FLAC"
    },
    Element {
        category: FileChecksum,
        value: "1234ABCD"
    },
    Element {
        category: AnimeYear,
        value: "2008"
    },
    Element {
        category: EpisodeNumber,
        value: "01"
    },
    Element {
        category: ReleaseVersion,
        value: "2"
    },
    Element {
        category: AnimeTitle,
        value: "Toradora!"
    },
    Element {
        category: ReleaseGroup,
        value: "TaigaSubs"
    },
    Element {
        category: EpisodeTitle,
        value: "Tiger and Dragon"
    }
]

Dependencies

~120–290KB