A Python client for the PhonkersBase API
Project description
PhonkersBase Python Client
A Python client library for interacting with the PhonkersBase API (phonkersbase.com).
Features
- Search and retrieve artists from PhonkersBase
- Filter artists by label and country
- Built-in caching support
- Pagination helpers
- Type hints support
- Error handling
Installation
pip install phonkersbase
Quick Start
from phonkersbase import phonkerbase, ArtistLabel
# Basic usage
artists = phonkerbase.search_artists("phonk")
# Filter by label
approved_artists = phonkerbase.get_artists_by_label(ArtistLabel.APPROVED)
# Filter by country
uk_artists = phonkerbase.get_artists_by_country("uk")
# Paginate through all results
all_artists = phonkerbase.paginate_all_artists(label=ArtistLabel.APPROVED)
API Reference
PhonkersBaseAPI
The main client class for interacting with the PhonkersBase API.
client = PhonkersBaseAPI(
timeout=10, # Request timeout in seconds
cache_ttl=3600, # Cache TTL in seconds
cache_size=2048 # Maximum number of cached items
)
Methods
get_artists(search=None, label=None, country=None, limit=25, offset=0, locale='uk')get_countries()search_artists(query, **kwargs)get_artists_by_label(label, **kwargs)get_artists_by_country(country, **kwargs)paginate_all_artists(**kwargs)clear_cache()get_cache_info()
Artist Labels
Available artist labels (via ArtistLabel enum):
- BASE
- APPROVED
- UNKNOWN
- PRIDE
- BLOCKED
- WARNING
Error Handling
The library uses the PhonkersBaseException class for error handling:
try:
artists = phonkerbase.search_artists("archez")
except PhonkersBaseException as e:
print(f"API Error: {e}")
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file phonkersbase-0.2.0.tar.gz.
File metadata
- Download URL: phonkersbase-0.2.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f044cbeffcd0d8be529aae499d884f20e945d7d28a1246ed7930f70598a1470
|
|
| MD5 |
97d8c7819266d4b073c65f2ad868321b
|
|
| BLAKE2b-256 |
fa91724719d9dd24b0f7b9dc7243609640d9382388ced9b72790a9d9bc4ff5c5
|
File details
Details for the file phonkersbase-0.2.0-py3-none-any.whl.
File metadata
- Download URL: phonkersbase-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3eabf4d412afd10e81b9b134b7304f4c43322e19178bae13cff0bfa858675be
|
|
| MD5 |
102f5f0aad5aa881d00e73012cec1af1
|
|
| BLAKE2b-256 |
152be63edfd876b06a92234d1e36df4bb3ea985ac7edaecc82c1a71d20ae1812
|