:py:mod:`calliope.bandcamp` =========================== .. py:module:: calliope.bandcamp .. autoapi-nested-parse:: Access data from `Bandcamp `_. This module wraps a local fork of the `bandcamp_api `_ library. Additionally, some information is scraped from the Bandcamp website using BeautifulSoup4. Authentication -------------- All the APIs used by this module can be accessed without authentication. Caching ------- FIXME: some requests are cached now. HTTP requests are not cached. At time of writing, ``api.bandcamp.com`` requests send the HTTP header ``Cache-Control: no-cache, no-store``. Web pages that are scraped for data will get cached, see function documentation for more details. Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: calliope.bandcamp.BandcampContext Functions ~~~~~~~~~ .. autoapisummary:: calliope.bandcamp.export_band calliope.bandcamp.export_album calliope.bandcamp.collection calliope.bandcamp.wishlist .. py:exception:: ScrapeError Bases: :py:obj:`RuntimeError` Unspecified run-time error. Initialize self. See help(type(self)) for accurate signature. .. py:class:: BandcampContext(config, user = None) Context for accessing Bandcamp API. :param user: Default user for requests .. py:method:: get_fan_id() .. py:function:: export_band(context, band_url, expand_albums=False, cache_expiry = None) Export all albums for a Bandcamp artist or label. This uses web scraping as I am not aware of an API that provides the info. It may provide incomplete data and may stop working based on changes to the Bandcamp site. The remote page is cached, and by default is only refreshed if older than 1 week. Use ``cache_expiry`` to set a different expiry interval. .. py:function:: export_album(context, album_url=None, album_id=None, cache_expiry=None) Export all tracks in an album The remote page is cached, and by default is never refreshed. Use ``cache_expiry`` to set an expiry interval if needed. .. py:function:: collection(bandcamp, count=1000) Export all albums in Bandcamp collection. .. py:function:: wishlist(bandcamp, count=1000) Export all albums in Bandcamp wishlist.