Skip to main content

bandcamp-search

Library to search for music on Bandcamp.

Installation

pip install bandcamp-search

Usage

Sample usage is in bandcamp_search/__main__.py:

import sys
from typing import cast

from bandcamp_search.search import search
from bandcamp_search.models import (
    AlbumSearchResult,
    ArtistLabelSearchResult,
    SearchType,
    TrackSearchResult,
)

if __name__ == "__main__":
    query = sys.argv[1]
    results = search(query, SearchType.ALL)
    for result in results["auto"]["results"]:
        if result["type"] == SearchType.ALBUMS:
            result = cast(AlbumSearchResult, result)
            print(f"Album: {result['name']}")
            print(f"  by {result['band_name']}")
            print(f"  buy at {result['item_url_path']}")
        if result["type"] == SearchType.ARTISTS_AND_LABELS:
            result = cast(ArtistLabelSearchResult, result)
            print("Artist/Label: {result['name']}")
            print(f"  {result['location']}")
        if result["type"] == SearchType.TRACKS:
            result = cast(TrackSearchResult, result)
            print(f"Track: {result['name']}")
            print(f"  on {result['album_name']} by {result['band_name']}")
            print(f"  listen at {result['item_url_path']}")

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bandcamp_search-0.1.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bandcamp_search-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file bandcamp_search-0.1.0.tar.gz.

File metadata

  • Download URL: bandcamp_search-0.1.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Linux/5.15.0-112-generic

File hashes

Hashes for bandcamp_search-0.1.0.tar.gz
Algorithm Hash digest
SHA256 de289b9ec4170796b41d84a0104d2e31a783c880204ad82f5bc23c0142ce6148
MD5 51151b48df6bd3a5f2f9d10cba5bf5d6
BLAKE2b-256 20e6c186e69acdb7eb72687d1d24c46d7c7bd15c2a3a4d4d62ac9398d98da937

See more details on using hashes here.

File details

Details for the file bandcamp_search-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bandcamp_search-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Linux/5.15.0-112-generic

File hashes

Hashes for bandcamp_search-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ef0acb80ca56bee76aaa25c48c342ae8a6cbf526b86c2c5cdc94c3561ef9e3a
MD5 edabd957670829f568095cf230e5c968
BLAKE2b-256 12de65c92c9871ddde1a200f19636388da4ba8f56643afeecf787372f0ac5d95

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page