Skip to main content

Crate zantetsu_vecdb

Crate zantetsu_vecdb 

Source
Expand description

§Zantetsu VecDB

Canonical title matching for parsed anime names.

The current implementation supports two backends:

  • A local Kitsu SQL dump (latest.sql or latest.sql.gz)
  • A remote GraphQL endpoint compatible with the expected anime search schema

Crates:

§Examples

Use a local Kitsu dump:

use zantetsu_vecdb::{MatchSource, TitleMatcher};

let matcher = TitleMatcher::new(
    MatchSource::kitsu_dump("/home/user/.local/share/zantetsu/kitsu-dumps"),
)
.unwrap();

let best = matcher.match_title("Sousou no Frieren").unwrap();
assert!(best.is_some());

Use a remote GraphQL endpoint:

use zantetsu_vecdb::{MatchSource, TitleMatcher};

let matcher = TitleMatcher::new(
    MatchSource::remote_endpoint("https://graphql.anilist.co"),
)
.unwrap();

let best = matcher.match_title("Spy x Family").unwrap();
assert!(best.is_some());

Re-exports§

pub use error::MatchResult;
pub use error::MatcherError;

Modules§

error

Structs§

AnimeIds
External and internal identifiers for a matched anime.
AnimeTitleMatch
The best-scoring match for a query title.
TitleMatcher
Canonical title matcher backed by either a local Kitsu dump or a remote GraphQL endpoint.

Enums§

MatchProvider
Which backend produced a canonical title match.
MatchSource
Backend choice for canonical title matching.

Functions§

default_kitsu_dump_dir
Returns the default dump directory used by kitsu-sync.