Metadata-Version: 2.4
Name: pymusicbrainz
Version: 0.2.0
Summary: Typed sync + async client for the MusicBrainz WS/2 API
Keywords: musicbrainz,cover art archive,music,metadata,api client
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: AnyIO
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Multimedia :: Sound/Audio
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Dist: httpx2>=2.16.0
Requires-Dist: pydantic>=2.14.3
Requires-Dist: typing-extensions>=4.13
Requires-Dist: rich>=15.0.0 ; extra == 'cli'
Requires-Dist: typer>=0.28.0 ; extra == 'cli'
Requires-Dist: httpx2[socks] ; extra == 'socks'
Requires-Python: >=3.12
Project-URL: Homepage, https://github.com/illesnagy1/pymusicbrainz
Project-URL: Documentation, https://illesnagy1.github.io/pymusicbrainz/
Project-URL: Repository, https://github.com/illesnagy1/pymusicbrainz
Project-URL: Issues, https://github.com/illesnagy1/pymusicbrainz/issues
Project-URL: Changelog, https://github.com/illesnagy1/pymusicbrainz/releases
Provides-Extra: cli
Provides-Extra: socks
Description-Content-Type: text/markdown

# pymusicbrainz

[![PyPI](https://img.shields.io/pypi/v/pymusicbrainz)](https://pypi.org/project/pymusicbrainz/)
[![Python](https://img.shields.io/pypi/pyversions/pymusicbrainz?logo=python&logoColor=white)](https://pypi.org/project/pymusicbrainz/)
[![License](https://img.shields.io/github/license/illesnagy1/pymusicbrainz)](https://github.com/illesnagy1/pymusicbrainz/blob/main/LICENSE)
[![Tests](https://img.shields.io/github/actions/workflow/status/illesnagy1/pymusicbrainz/release.yml?branch=main&label=tests)](https://github.com/illesnagy1/pymusicbrainz/actions/workflows/release.yml)
[![MusicBrainz API](https://img.shields.io/github/actions/workflow/status/illesnagy1/pymusicbrainz/api-check.yml?branch=main&label=MusicBrainz%20API)](https://github.com/illesnagy1/pymusicbrainz/actions/workflows/api-check.yml)
[![Docs](https://img.shields.io/github/actions/workflow/status/illesnagy1/pymusicbrainz/docs.yml?branch=main&label=docs)](https://illesnagy1.github.io/pymusicbrainz/)

[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![ty](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ty/main/assets/badge/v0.json)](https://github.com/astral-sh/ty)
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)

A typed Python client for the
[MusicBrainz WS/2 API](https://musicbrainz.org/doc/MusicBrainz_API) and the
[Cover Art Archive](https://coverartarchive.org/), with sync and async clients,
rate limiting and retries built in, and a JSON command-line tool.

```python
from pymusicbrainz import MusicBrainz

with MusicBrainz("MyApp", "1.0", "me@example.com") as mb:
    nirvana = mb.artists.search(artist="Nirvana", country="US", limit=1)[0]

    for rg in mb.release_groups.iter_browse(artist=nirvana.id, release_type="album"):
        print(rg.first_release_date, rg.title)
```

```sh
pymusicbrainz search artist "Daft Punk" --limit 3
```

## Installation

Requires Python 3.12 or later.

```sh
uv add pymusicbrainz            # the library
uv add 'pymusicbrainz[cli]'     # plus the pymusicbrainz command
```

Runnable scripts are in [`examples/`](https://github.com/illesnagy1/pymusicbrainz/tree/main/examples): an artist's discography,
cover art download, identifying a CD, concurrent ISRC lookups, and collection
export.

## Documentation

The full guide and API reference are at
<https://illesnagy1.github.io/pymusicbrainz/>. To browse them locally:

```sh
uv run zensical serve
```

## Development

```sh
uv sync
uv run pytest        # offline tests
uv run ruff check .  # lint
uv run ty check      # type check
```

Pull request titles must be [conventional
commits](https://www.conventionalcommits.org/) (`feat: …`, `fix: …`): they become
the changelog. Releases are made by merging the bot's `chore(release): vX.Y.Z`
pull request. See the [development guide](https://illesnagy1.github.io/pymusicbrainz/development/) for the architecture and
conventions.
