Files
librespot-python/CONTRIBUTING.md
2025-10-13 03:29:36 -04:00

1.6 KiB

Contributing

What this library is

  • A headless Spotify client, allowing you to authenticate and retrieve a decrypted audio stream for any track.
  • Not a standalone audio player: the provided stream must be piped to another application (like ffplay) or handled by a server to be played.

Environment setup

Prerequisites

  • Python 3.10+

Install runtime packages

pip install -r requirements.txt

Install protoc

This step is only needed if you're changing any .proto serialization schema files, which will subsequently require using the protoc compiler to generate updated versions of the *_pb2.py Python stubs that implement serialization/deserialization for those schemas.

After modifying the .proto files you need to, make sure to follow these steps to regenerate the Python stubs.

Protocol buffer generation

These steps are only necessary after changing .proto files.

  • From the repository root, conveniently recompile all .proto schema files with this command:

    find proto -name "*.proto" | xargs protoc -I=proto --python_out=librespot/proto
    
  • Alternatively, to recompile a single file (e.g. proto/metadata.proto), run:

    protoc -I=proto --python_out=librespot/proto proto/metadata.proto
    
  • Commit both the source .proto and the regenerated Python output together so they can be compared easily.