aioslsk


Nameaioslsk JSON
Version 1.3.1 PyPI version JSON
download
home_pagehttps://github.com/JurgenR/aioslsk/
SummaryAsyncio based SoulSeek client
upload_time2024-05-05 17:14:48
maintainerNone
docs_urlNone
authorJurgenR
requires_python<3.13,>=3.8
licenseGPL-3.0-or-later
keywords soulseek p2p async
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            =======
aioslsk
=======

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

Supported Python versions are currently 3.8 - 3.12

You can find the full documentation `here <http://aioslsk.readthedocs.io/>`_

Installation
============

.. code-block:: shell

    pip install aioslsk


Quick Start
===========

Starting the client and sending a private message:

.. code-block:: python

    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:

.. code-block:: shell

    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``)
2. Run ``poetry run python -m tools.debug.debug_mode`` to start the REPL
3. Run an example command: ``>>> 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


Dependencies
------------

The package uses several dependencies:

* mutagen_ : library used for extracting audio metadata
* aiofiles_ : asyncio library for filesystem management
* async-upnp-client_ : library for managing UPnP configuration
* pydantic-settings_ : library for managing settings
* async-timeout_ : library providing timeout class


Building the documentation
--------------------------

.. code-block:: shell

    cd docs/
    poetry run make html


Running Tests
-------------

Running all tests:

.. code-block:: shell

    poetry run pytest tests/

Running all tests with code coverage report:

.. code-block:: shell

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

Running the mock server:

.. code-block:: shell

    poetry run python -m tests.e2e.mock.server
    poetry run python -m tests.e2e.mock.server --port 12345 54321


.. _poetry: https://python-poetry.org/
.. _mutagen: https://github.com/quodlibet/mutagen
.. _aiofiles: https://github.com/Tinche/aiofiles
.. _async-upnp-client: https://github.com/StevenLooman/async_upnp_client
.. _pydantic-settings: https://docs.pydantic.dev/latest/concepts/pydantic_settings/
.. _async-timeout: https://github.com/aio-libs/async-timeout

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/JurgenR/aioslsk/",
    "name": "aioslsk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.8",
    "maintainer_email": null,
    "keywords": "soulseek, p2p, async",
    "author": "JurgenR",
    "author_email": "1249228+JurgenR@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/bd/6c/e8384ff18231d309ae326b1ddf0272fc02b9e417ca4c0488b56b829dc752/aioslsk-1.3.1.tar.gz",
    "platform": null,
    "description": "=======\naioslsk\n=======\n\naioslsk is a Python library for the SoulSeek protocol built on top of asyncio.\n\nSupported Python versions are currently 3.8 - 3.12\n\nYou can find the full documentation `here <http://aioslsk.readthedocs.io/>`_\n\nInstallation\n============\n\n.. code-block:: shell\n\n    pip install aioslsk\n\n\nQuick Start\n===========\n\nStarting the client and sending a private message:\n\n.. code-block:: python\n\n    import asyncio\n    from aioslsk.client import SoulSeekClient\n    from aioslsk.commands import PrivateMessageCommand\n    from aioslsk.settings import Settings, CredentialsSettings\n\n    # Create default settings and configure credentials\n    settings: Settings = Settings(\n        credentials=CredentialsSettings(\n            username='my_user',\n            password='Secret123'\n        )\n    )\n\n    async def main():\n        client: SoulSeekClient = SoulSeekClient(settings)\n\n        await client.start()\n        await client.login()\n\n        # Send a private message\n        await client.execute(PrivateMessageCommand('my_friend', 'Hi!'))\n\n        await client.stop()\n\n    asyncio.run(main())\n\n\nDevelopment\n===========\n\nInstall poetry_ and setup the project dependencies by running:\n\n.. code-block:: shell\n\n    poetry install\n\n\nA tool is available to start the client for debugging purposes (try out commands to the server, ...):\n\n1. Create a ``settings.json`` file containing valid credentials in the ``tools/debug/`` directory (or pass a path using ``--settings``)\n2. Run ``poetry run python -m tools.debug.debug_mode`` to start the REPL\n3. Run an example command: ``>>> await client(cmds.GetPeerAddressCommand('some user'), response=True)``\n4. To close the REPL execute ``exit()`` or press ``Ctrl+Z``\n\nOptionally the script takes a ``--cache-dir`` that will read/write the transfer and shares cache from the given directory\n\n\nDependencies\n------------\n\nThe package uses several dependencies:\n\n* mutagen_ : library used for extracting audio metadata\n* aiofiles_ : asyncio library for filesystem management\n* async-upnp-client_ : library for managing UPnP configuration\n* pydantic-settings_ : library for managing settings\n* async-timeout_ : library providing timeout class\n\n\nBuilding the documentation\n--------------------------\n\n.. code-block:: shell\n\n    cd docs/\n    poetry run make html\n\n\nRunning Tests\n-------------\n\nRunning all tests:\n\n.. code-block:: shell\n\n    poetry run pytest tests/\n\nRunning all tests with code coverage report:\n\n.. code-block:: shell\n\n    poetry run pytest --cov=aioslsk --cov-report term-missing tests/\n\nRunning the mock server:\n\n.. code-block:: shell\n\n    poetry run python -m tests.e2e.mock.server\n    poetry run python -m tests.e2e.mock.server --port 12345 54321\n\n\n.. _poetry: https://python-poetry.org/\n.. _mutagen: https://github.com/quodlibet/mutagen\n.. _aiofiles: https://github.com/Tinche/aiofiles\n.. _async-upnp-client: https://github.com/StevenLooman/async_upnp_client\n.. _pydantic-settings: https://docs.pydantic.dev/latest/concepts/pydantic_settings/\n.. _async-timeout: https://github.com/aio-libs/async-timeout\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-or-later",
    "summary": "Asyncio based SoulSeek client",
    "version": "1.3.1",
    "project_urls": {
        "Documentation": "https://readthedocs.org/projects/aioslsk/",
        "Homepage": "https://github.com/JurgenR/aioslsk/",
        "Repository": "https://github.com/JurgenR/aioslsk/"
    },
    "split_keywords": [
        "soulseek",
        " p2p",
        " async"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "daa16a60bc7c0d3db457c02b56f1fae38fe5869bcca3214d95e1600bed6a360f",
                "md5": "18583dce62f341edd4a641c81f7cf387",
                "sha256": "f3fc80565bf4b09caa0c6dde4e3be60215c2c01e9f92ed8e61c3bcce0cd3eb0f"
            },
            "downloads": -1,
            "filename": "aioslsk-1.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "18583dce62f341edd4a641c81f7cf387",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.8",
            "size": 112953,
            "upload_time": "2024-05-05T17:14:46",
            "upload_time_iso_8601": "2024-05-05T17:14:46.557799Z",
            "url": "https://files.pythonhosted.org/packages/da/a1/6a60bc7c0d3db457c02b56f1fae38fe5869bcca3214d95e1600bed6a360f/aioslsk-1.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bd6ce8384ff18231d309ae326b1ddf0272fc02b9e417ca4c0488b56b829dc752",
                "md5": "9f1f79508ae6199058eef1210aee4d15",
                "sha256": "a2b5488ec991a56a4ed8a84cdb992dfad1d8449e4e2d31b0dc5263e8bc263146"
            },
            "downloads": -1,
            "filename": "aioslsk-1.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "9f1f79508ae6199058eef1210aee4d15",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.8",
            "size": 98969,
            "upload_time": "2024-05-05T17:14:48",
            "upload_time_iso_8601": "2024-05-05T17:14:48.790105Z",
            "url": "https://files.pythonhosted.org/packages/bd/6c/e8384ff18231d309ae326b1ddf0272fc02b9e417ca4c0488b56b829dc752/aioslsk-1.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-05 17:14:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "JurgenR",
    "github_project": "aioslsk",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "aioslsk"
}
        
Elapsed time: 0.24613s