a python client for the setlist.fm api
Project description
setlist-fm-client
setlist-fm-client
is a python client for the setlist.fm REST API.
Installation
pip
pip install setlist-fm-client
poetry
poetry add setlist-fm-client
Help
See the documentation for more details.
Authentication
In order to authenticate to the setlist.fm REST API, you must apply for an API key (link for logged-in users only) - if you're not registered user yet, then register first (it's free).
Once you have your key, you can use it in the setlist-fm-client by setting the SETLIST_FM_API_KEY
environment
variable or by passing api_key="xxx"
as a kwarg to any function (see docs).
Simple Example
setlist-fm-client is extremely easy to use. By setting serialize=True
, you get a pydantic model returned to you instead of
a httpx.Response
object.
Below are examples of what the code looks like for both the sync and async apis.
sync
import setlist_fm_client
setlists = setlist_fm_client.get_artist_setlists(
"0bfba3d3-6a04-4779-bb0a-df07df5b0558", api_key="xxx", serialize=True
)
print(setlists)
async
import asyncio
import setlist_fm_client
async def main():
setlists = await setlist_fm_client.get_artist_setlists(
"0bfba3d3-6a04-4779-bb0a-df07df5b0558", api_key="xxx", serialize=True
)
print(setlists)
asyncio.run(main())
This will give you an ArtistSetListResponse
object.
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
Hashes for setlist_fm_client-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d6141e12e16431c78787f8c9d2cfad2209f5b95646966421b9fe493295acaa5 |
|
MD5 | 762da0208fdc1725ed76fb9949bf9317 |
|
BLAKE2b-256 | 561d0206d51aef5d5e1cb52ec9ac451b0842743ad28bdfc99b45ff21bf82ca14 |