/slskd-python-client

A slskd python client

Primary LanguagePython

slskd

A python client for slskd

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 0.17.8.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.PythonNextgenClientCodegen For more information, please visit https://paolino.me

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/crmne/slskd-python-client.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/crmne/slskd-python-client.git)

Then import the package:

import slskd

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import slskd

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import time
import slskd
from slskd.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:5030/api/v0
# See configuration.py for a list of all supported configuration parameters.
configuration = slskd.Configuration(
    host = "http://localhost:5030/api/v0"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'


# Enter a context with an instance of the API client
async with slskd.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = slskd.ApplicationApi(api_client)

    try:
        # Stops the application.
        api_response = await api_instance.application_delete()
        print("The response of ApplicationApi->application_delete:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ApplicationApi->application_delete: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost:5030/api/v0

Class Method HTTP request Description
ApplicationApi application_delete DELETE /application Stops the application.
ApplicationApi application_dump_get GET /application/dump
ApplicationApi application_gc_post POST /application/gc Forces garbage collection.
ApplicationApi application_get GET /application Gets the current state of the application.
ApplicationApi application_put PUT /application Restarts the application.
ApplicationApi application_version_get GET /application/version Gets the current application version.
ApplicationApi application_version_latest_get GET /application/version/latest Checks for updates.
ConversationsApi conversations_get GET /conversations Gets all active conversations.
ConversationsApi conversations_username_delete DELETE /conversations/{username} Closes the conversation associated with the given username.
ConversationsApi conversations_username_get GET /conversations/{username} Gets the conversation associated with the specified username.
ConversationsApi conversations_username_id_put PUT /conversations/{username}/{id} Acknowledges the given message id for the given username.
ConversationsApi conversations_username_messages_get GET /conversations/{username}/messages
ConversationsApi conversations_username_post POST /conversations/{username} Sends a private message to the specified username.
ConversationsApi conversations_username_put PUT /conversations/{username} Acknowledges all messages from the given username.
LogsApi logs_get GET /logs Gets the last few application logs.
MetricsApi metrics_get GET /metrics Gets application metrics.
OptionsApi options_debug_get GET /options/debug Gets the debug view of the current application options.
OptionsApi options_get GET /options Gets the current application options.
OptionsApi options_startup_get GET /options/startup Gets the application options provided at startup.
OptionsApi options_yaml_get GET /options/yaml
OptionsApi options_yaml_location_get GET /options/yaml/location
OptionsApi options_yaml_post POST /options/yaml
OptionsApi options_yaml_validate_post POST /options/yaml/validate
PublicChatApi publicchat_delete DELETE /publicchat Stops public chat.
PublicChatApi publicchat_post POST /publicchat Starts public chat.
RelayApi relay_agent_delete DELETE /relay/agent Disconnects from the connected controller.
RelayApi relay_agent_put PUT /relay/agent Connects to the configured controller.
RelayApi relay_controller_downloads_token_get GET /relay/controller/downloads/{token} Downloads a file from the connected controller.
RelayApi relay_controller_files_token_post POST /relay/controller/files/{token} Uploads a file to the connected controller.
RelayApi relay_controller_shares_token_post POST /relay/controller/shares/{token} Uploads share information to the connected controller.
RoomsApi rooms_available_get GET /rooms/available Gets a list of rooms from the server.
RoomsApi rooms_joined_get GET /rooms/joined Gets all rooms.
RoomsApi rooms_joined_post POST /rooms/joined Joins a room.
RoomsApi rooms_joined_room_name_delete DELETE /rooms/joined/{roomName} Leaves a room.
RoomsApi rooms_joined_room_name_get GET /rooms/joined/{roomName} Gets the specified room.
RoomsApi rooms_joined_room_name_members_post POST /rooms/joined/{roomName}/members Adds a member to a private room.
RoomsApi rooms_joined_room_name_messages_get GET /rooms/joined/{roomName}/messages Gets the current list of messages for the specified room.
RoomsApi rooms_joined_room_name_messages_post POST /rooms/joined/{roomName}/messages Sends a message to the specified room.
RoomsApi rooms_joined_room_name_ticker_post POST /rooms/joined/{roomName}/ticker Sets a ticker for the specified room.
RoomsApi rooms_joined_room_name_users_get GET /rooms/joined/{roomName}/users Gets the current list of users for the specified room.
SearchesApi searches_get GET /searches Gets the list of active and completed searches.
SearchesApi searches_id_delete DELETE /searches/{id} Deletes the search corresponding to the specified id.
SearchesApi searches_id_get GET /searches/{id} Gets the state of the search corresponding to the specified id.
SearchesApi searches_id_put PUT /searches/{id} Stops the search corresponding to the specified id.
SearchesApi searches_id_responses_get GET /searches/{id}/responses Gets the state of the search corresponding to the specified id.
SearchesApi searches_post POST /searches Performs a search for the specified request.
ServerApi server_delete DELETE /server Disconnects the client.
ServerApi server_get GET /server Retrieves the current state of the server.
ServerApi server_put PUT /server Connects the client.
SessionApi session_enabled_get GET /session/enabled Checks whether security is enabled.
SessionApi session_get GET /session Checks whether the provided authentication is valid.
SessionApi session_post POST /session Logs in.
SharesApi shares_contents_get GET /shares/contents Returns a list of all shared directories and files.
SharesApi shares_delete DELETE /shares Cancels a share scan, if one is running.
SharesApi shares_get GET /shares Gets the current list of shares.
SharesApi shares_id_contents_get GET /shares/{id}/contents Gets the contents of the share associated with the specified <see paramref=&quot;id&quot; />.
SharesApi shares_id_get GET /shares/{id} Gets the share associated with the specified <see paramref=&quot;id&quot; />.
SharesApi shares_put PUT /shares Initiates a scan of the configured shares.
TransfersApi transfers_downloads_all_completed_delete DELETE /transfers/downloads/all/completed Removes all completed downloads, regardless of whether they failed or succeeded.
TransfersApi transfers_downloads_get GET /transfers/downloads Gets all downloads.
TransfersApi transfers_downloads_username_get GET /transfers/downloads/{username} Gets all downloads for the specified username.
TransfersApi transfers_downloads_username_id_delete DELETE /transfers/downloads/{username}/{id} Cancels the specified download.
TransfersApi transfers_downloads_username_id_get GET /transfers/downloads/{username}/{id}
TransfersApi transfers_downloads_username_id_position_get GET /transfers/downloads/{username}/{id}/position Gets the downlaod for the specified username matching the specified filename, and requests the current place in the remote queue of the specified download.
TransfersApi transfers_downloads_username_post POST /transfers/downloads/{username} Enqueues the specified download.
TransfersApi transfers_uploads_all_completed_delete DELETE /transfers/uploads/all/completed Removes all completed uploads, regardless of whether they failed or succeeded.
TransfersApi transfers_uploads_get GET /transfers/uploads Gets all uploads.
TransfersApi transfers_uploads_username_get GET /transfers/uploads/{username} Gets all uploads for the specified username.
TransfersApi transfers_uploads_username_id_delete DELETE /transfers/uploads/{username}/{id} Cancels the specified upload.
TransfersApi transfers_uploads_username_id_get GET /transfers/uploads/{username}/{id} Gets the upload for the specified username matching the specified filename.
UsersApi users_username_browse_get GET /users/{username}/browse Retrieves the files shared by the specified username.
UsersApi users_username_browse_status_get GET /users/{username}/browse/status Retrieves the status of the current browse operation for the specified username, if any.
UsersApi users_username_directory_post POST /users/{username}/directory Retrieves the files from the specified directory from the specified username.
UsersApi users_username_endpoint_get GET /users/{username}/endpoint Retrieves the address of the specified username.
UsersApi users_username_info_get GET /users/{username}/info Retrieves information about the specified username.
UsersApi users_username_status_get GET /users/{username}/status Retrieves status for the specified username.

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • Type: API key
  • API key parameter name: X-API-KEY
  • Location: HTTP header

Author

carmine@paolino.me