Crate ape

source ·
Expand description

A library for reading and writing APEv2 tags.

An APE tag is a tag used to add metadata (title, artist, album, etc…) to digital audio files.

Read the specification for more information.

Examples

Creating a tag

use ape::{Item, Tag, write_to_path};

let mut tag = Tag::new();
let item = Item::from_text("artist", "Artist Name").unwrap();
tag.set_item(item);
write_to_path(&tag, "path/to/file").unwrap();

Reading a tag

use ape::read_from_path;

let tag = read_from_path("path/to/file").unwrap();
let item = tag.item("artist").unwrap();
println!("{:?}", item.value);

Updating a tag

use ape::{Item, write_to_path, read_from_path};

let path = "path/to/file";
let mut tag = read_from_path(path).unwrap();
let item = Item::from_text("album", "Album Name").unwrap();
tag.set_item(item);
tag.remove_items("cover");
write_to_path(&tag, path).unwrap();

Deleting a tag

use ape::remove_from_path;

remove_from_path("path/to/file").unwrap();

Structs

Represents an APE Tag Item.
An APE Tag containing APE Tag Items.

Enums

Describes all errors that may occur.

Functions

Attempts to read an APE tag from a reader
Attempts to read an APE tag from the file at the specified path.
Attempts to remove an APE tag from a File
Attempts to remove APE tag from the file at the specified path.
Attempts to write the APE tag to a File.
Attempts to write the APE tag to the file at the specified path.

Type Definitions

A specialized Result type for metadata operations.