Skip to main content

A modern api wrapper

Project description


pydrag is a modern api wrapper for the api with a fluent syntax!

Quick Start

Apply for a api key and write down your key and secret.


$ pip install pydrag


>>> from pydrag import User, configure
>>> configure(api_key='54062d8af7afdc_not_real_3459048a4')
>>> rj = User.find("RJ")
>>> rj.real_name
'Richard Jones '
>>> recent = rj.get_recent_tracks(limit=1, page=1)
>>> first = recent.pop()
>>> similar = first.get_similar(limit=1)
>>> similar[0].name
'Family Business'
>>> similar[0]
>>> for friend in rj.get_friends(recent_tracks=True):
('meichi', 'Pi')
('demkod', '(bottle back)')
('STBKilla', 'Nowhere Fast')
('keret221', 'Letter Home')
('Lilfix', 'Namorar pra Quê?')
('Yoji', 'Empire State of Mind (feat. Alicia Keys)')
('Kastishka', 'Wipe Your Eyes')
('comingsoon_', 'I Want It All')
('Bagheera', 'Welcome Home')


Use you favorite tool to create a python >= 3.6 virtual environment

$ git clone
$ pip install .[dev]
$ pre-commit install
$ pytest
$ tox

pydrag uses vcrpy library to record and replay responses for its unit tests and python-dotenv to auto-configure itself.

All sensitive information like keys and credentials are automatically censored.

So when it’s necessary to record a new response it’s super useful to have a .env file with your configuration!


Changelog: 22.5 (2022-05-08)

  • Replaced attrs with dataclasses
  • Added support for python 3.10

Project details

Download files

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

Source Distribution

pydrag-22.5.tar.gz (228.3 kB view hashes)

Uploaded source

Built Distribution

pydrag-22.5-py3-none-any.whl (23.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page