Skip to main content

aioslsk

aioslsk is a Python library for the SoulSeek protocol built on top of asyncio.

Supported Python versions are currently 3.11 - 3.15

You can find the full documentation here

Installation

pip install aioslsk

Quick Start

Starting the client and sending a private message:

import asyncio
from aioslsk.client import SoulSeekClient
from aioslsk.commands import PrivateMessageCommand
from aioslsk.settings import Settings, CredentialsSettings

# Create default settings and configure credentials
settings: Settings = Settings(
    credentials=CredentialsSettings(
        username='my_user',
        password='Secret123'
    )
)

async def main():
    client: SoulSeekClient = SoulSeekClient(settings)

    await client.start()
    await client.login()

    # Send a private message
    await client.execute(PrivateMessageCommand('my_friend', 'Hi!'))

    await client.stop()

asyncio.run(main())

Development

Install poetry and setup the project dependencies by running:

poetry install

A tool is available to start the client for debugging purposes (try out commands to the server, …):

  1. Create a settings.json file containing valid credentials in the tools/debug/ directory (or pass a path using --settings). To generate a simple settings file:

    poetry run python -m aioslsk.settings generate -u "Hello" -p "World" > tools/debug/settings.json
  2. To start the REPL run:

    # Reads from tools/debug/settings.json
    poetry run python -m tools.debug.debug_mode
    # Reads from specific file
    poetry run python -m tools.debug.debug_mode --settings ~/custom_settings.json
  3. Run an example command (the aioslsk.commands module is aliased to the cmds variable):

    await client(cmds.GetPeerAddressCommand('some user'), response=True)
  4. To close the REPL execute exit() or press Ctrl+Z

Optionally the script takes a --cache-dir that will read/write the transfer and shares cache from the given directory

Building the documentation

cd docs/
poetry run make html

Running Tests

Running all tests:

poetry run pytest tests/

Running all tests with code coverage report:

poetry run pytest --cov=aioslsk --cov-report term-missing tests/

By default the logs are only shown in case of failure. To enable all logging output during testing run the tests as follows:

poetry run pytest tests/ -o log_cli=true

Mock Server

A mock server implementation is available for testing, to start the server run:

# By default the server listens on port 2416
poetry run python -m tests.e2e.mock.server
# Specifying multiple listening ports
poetry run python -m tests.e2e.mock.server --port 2416 2242

Configure the hostname or IP of the server in your client and connect. If such configuration is not possible you can add an entry to the hosts file of your system. For example:

127.0.0.1      server.slsknet.org

Use --help to get a list of available options.

Dependencies

The package uses several dependencies:

Metadata

Release files for aioslsk 1.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aioslsk 1.7.2
File Size Uploaded Provenance Actions
aioslsk-1.7.2.tar.gz 116.3 kB Without provenance Details for aioslsk-1.7.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aioslsk 1.7.2
File Interpreter ABI Platform Actions
aioslsk-1.7.2-py3-none-any.whl Python 3 none any Details for aioslsk-1.7.2-py3-none-any.whl

Total release size: 249.2 kB

Release files / aioslsk-1.7.2.tar.gz

Download URL aioslsk-1.7.2.tar.gz
Size 116.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ba5d963ee681279fb5cd9133493875d5d617a78872b58b1f98adc3d917d9a47d
BLAKE2b-256 checksum
How to use checksums
2ba8b0d488368f7a13319f7d050c036cb64bb8d44d6749d82b6db7dc4c92df22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.0 CPython/3.14.4 Linux/7.0.0-1019-azure

Release files / aioslsk-1.7.2-py3-none-any.whl

Download URL aioslsk-1.7.2-py3-none-any.whl
Size 132.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ef5da9e1b50cbb09469da01fa721230a2a2abbda262d40294d920847d9ae663
BLAKE2b-256 checksum
How to use checksums
d32bc3989a36e8c81918ad8ebf6b8161718740ca20a90c0439aa06232efe5528
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.0 CPython/3.14.4 Linux/7.0.0-1019-azure

Security for aioslsk 1.7.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page