Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Client for interacting with the Spotify API
Full documentation for the library is available on Read the Docs
First install the package with pip:
pip install spotify-client
Then import the client for usage in your application:
from spotify_client import SpotifyClient
SPOTIFY_CLIENT_ID = 'client_id_from_spotify'
SPOTIFY_SECRET_KEY = 'secret_key_from_spotify'
client = SpotifyClient(SPOTIFY_CLIENT_ID, SPOTIFY_SECRET_KEY, identifier='test-spotify-client')
You'll need to generate your client ID and secret keys for authenticating with Spotify from their API console. You can find the steps for doing that in the Spotify documentation.
Optionally, you can also configure the client authentication configuration one time in a setup script by using the
Config
class:
from spotify_client import SpotifyClient
from spotify_client.config import Config
SPOTIFY_CLIENT_ID = 'client_id_from_spotify'
SPOTIFY_SECRET_KEY = 'secret_key_from_spotify'
Config.configure(SPOTIFY_CLIENT_ID, SPOTIFY_SECRET_KEY)
client = SpotifyClient()
The client will make a request to generate the access_token the first time it makes a call to the API. It will then cache the access token as an instance variable, to use in future requests by that client instance. This avoids the overhead of having to make a request for the access token on each request to the API.
You can optionally pass an identifier to the constructor. This will be used in logging messages by the client to uniquely identify logs for the client instance.
To work on this library, you'll first need to clone the repository:
git clone git@github.com:Moody-Tunes/spotify-client.git
Next, create a virtual environment and install the dependencies for development:
virtualenv -p $(which python3) venv
source venv/bin/activate
(venv) pip install -r dev.txt
We use pre-commit for running hooks during git commits. This will help immensely with developer workflow by running linters, checkers, and other tools when you make commits. To install pre-commit, create a virtual environment and install pre-commit:
(venv) pip install pre-commit
Next, install the pre-commit packages we use in our project:
(venv) pre-commit install
This should run the pre-commit hooks when you make a commit to the spotify-client repository.
We use pytest for running tests. You can run the spotify-client test suite by invoking pytest in the virtual environment:
(venv) pytest
We also use pytest-cov for reporting test coverage of the library. This will be displayed after the tests have finished running and report lines in the code that have test coverage.
FAQs
Client for interacting with the Spotify API
We found that spotify-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.