Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pyclassicalarchives

A typed Python client for Classical Archives, one of the largest classical music catalogues on the web.

The library wraps the site's public JSON API in dataclasses. Use it to browse curated and full A-Z composer lists, search by name, and fetch a composer's full page (biography, period, lifedates, albums, and works). Every model exposes a canonical id for de-duplication, and an optional metadatarr provider cross-references that id with other sources.

Install

pip install pyclassicalarchives
pip install pyclassicalarchives[stealth]   # adds curl-cffi (Chrome TLS), if ever gated
pip install pyclassicalarchives[dev]       # adds pytest

30-second tour

import pyclassicalarchives as ca

# Curated lists
for c in ca.get_notable_composers()[:5]:
    print(c.composer_id, c.display_name, c.country, c.birth, c.death)

# Search by name (surname-first or natural order both work)
bach = ca.search_composers("johann sebastian bach")[0]

# Full page: bio, period, albums, works
detail = ca.fetch_composer(bach.composer_id)
print(detail.life, detail.period)                 # (1685-1750) Baroque
print(len(detail.albums), "albums,", len(detail.works), "works")

# Canonical ids for dedup / cross-referencing
print(detail.to_external_ids_dict())
# {'classicalarchives_composer': '2113', 'classicalarchives_url': '.../composer/2113.html'}

What you can fetch

Function Returns Source endpoint
get_notable_composers() List[Composer] composer_list_notable.json
get_must_know_composers() List[Composer] mustknow_composers.json
get_composers_by_letter("B") List[Composer] composer_list_all.json?letter=
iter_all_composers() Iterator[Composer] the whole A-Z catalogue (lazy)
search_composers("mozart") List[Composer] client-side over the by-letter lists
fetch_composer(id) ComposerDetail composer_page.json?composer_id=

A ComposerDetail carries nested albums: List[Album] and works: List[Work]. The library flattens the works tree to leaf works, and tags each one with its full category path.

Documentation

Start with docs/quickstart.md, then:

Runnable, numbered scripts live in examples/.

Canonical ids and metadatarr

This package is a pure scraper. It exposes Classical Archives' stable ids through site_id and to_external_ids_dict():

bach = ca.search_composers("johann sebastian bach")[0]
bach.to_external_ids_dict()
# {'classicalarchives_composer': '2113',
#  'classicalarchives_url': 'https://www.classicalarchives.com/composer/2113.html'}

The metadatarr resolver consumes these ids. The MetadataProvider itself lives in the metadatarr repo (metadatarr/resolve/providers/classicalarchives.py), not here, so integration code stays out of client repos. Install both packages and metadatarr auto-discovers the provider. See docs/canonical_ids.md.

Download files

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

Source Distribution

pyclassicalarchives-0.0.1a2.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

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

pyclassicalarchives-0.0.1a2-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file pyclassicalarchives-0.0.1a2.tar.gz.

File metadata

  • Download URL: pyclassicalarchives-0.0.1a2.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyclassicalarchives-0.0.1a2.tar.gz
Algorithm Hash digest
SHA256 52a19110898896de0dd781389fff78e3f87f494b530948ee6dd00d2afbeea889
MD5 8e5f5a835a39efacd16a7d25f1cf10d1
BLAKE2b-256 b135d6acf4b9b7e396e70ac4371711b666cb63eeca8a85ca6946d0593b2719ca

See more details on using hashes here.

File details

Details for the file pyclassicalarchives-0.0.1a2-py3-none-any.whl.

File metadata

File hashes

Hashes for pyclassicalarchives-0.0.1a2-py3-none-any.whl
Algorithm Hash digest
SHA256 11040be25023969768f8dbd912e5e88e963c5c720448dc52042d235618e00e07
MD5 95a39c1066d75d1846e6cd48945a4a91
BLAKE2b-256 0cef9daa461fb368b09af27955a8080690f050fbcfd843f02d583810c2c36d24

See more details on using hashes here.

Supported by

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