bandcamp

Crates.iobandcamp
lib.rsbandcamp
version0.3.4
created_at2025-10-12 14:32:48.68033+00
updated_at2025-11-02 08:36:33.363904+00
descriptionBandcamp API wrapper
homepage
repositoryhttps://github.com/fabi321/bandcamp
max_upload_size
id1879356
size105,868
Fabian Wunsch (fabi321)

documentation

README

Bandcamp api

If you find any Artist/Album/Track that does not work, feel free to open an issue.

Installing

cargo add bandcamp

pip install bandcamp_lib

How to use

The Rust API and Python API are identical except for search results.

import bandcamp_lib

# From URL methods first need to search for the element in question, to get the id
artist = bandcamp_lib.artist_from_url("myrkur.bandcamp_lib.com")

for element in artist.discography:
    print(element.title, element.item_type)

# fetch_* methods only do one api call, but require an artist and album/track id
album = bandcamp_lib.fetch_album(artist.id, artist.discography[0].id)

for track in album.tracks:
    print(track.title)

search_results = bandcamp_lib.search("foo")

for result in search_results:
    if isinstance(result, bandcamp_lib.SearchResultItemAlbum):
        print("Got album", result.name)

Rust search API

use bandcamp::*;

fn main() {
    let search_results = search("foo").unwrap();
    for result in search_results {
        if let SearchResultItem::Album(album) = result {
            println!("Got album {}", album.name);
        }
    }
}
Commit count: 0

cargo fmt