Skip to main content
The core module handles application initialization, component management, and lifecycle operations.

Core Class

The Core class is the central component manager that initializes and coordinates all other modules.

Attributes

shares
Shares
Manages shared files and folders
users
Users
Handles user management and status tracking
network_filter
NetworkFilter
Controls user banning and IP filtering
Manages search functionality
downloads
Downloads
Handles file downloads
uploads
Uploads
Manages file uploads
chatrooms
ChatRooms
Controls chat room functionality
privatechat
PrivateChat
Manages private messages

Methods

init_components()

def init_components(self, enabled_components=None, isolated_mode=False)
Initializes all application components with optional selective enabling.
enabled_components
set
Set of component names to enable. If None, all components are enabled.
isolated_mode
bool
default:false
Whether to run in isolated mode (no network features)
Available components include: "error_handler", "signal_handler", "cli", "portmapper", "network_thread", "shares", "users", "search", "downloads", "uploads", "chatrooms", "privatechat", and more.

start()

def start(self)
Starts the application and emits the start event to all components.

connect()

def connect(self)
Connects to the Soulseek server using configured credentials.
from pynicotine.core import core
from pynicotine.config import config

# Load configuration
config.load_config()

# Initialize components
core.init_components()

# Start the application
core.start()

# Connect to server
core.connect()

disconnect()

def disconnect(self)
Disconnects from the Soulseek server.

quit()

def quit(self, signal_type=None, _frame=None)
Shuts down the application gracefully.
signal_type
int
Signal type if quit was triggered by a system signal

send_message_to_server()

def send_message_to_server(self, message)
Sends a protocol message to the Soulseek server.
message
ServerMessage
The message object to send

send_message_to_peer()

def send_message_to_peer(self, username, message)
Sends a protocol message to another peer.
username
str
Target peer’s username
message
PeerMessage
The message object to send

UpdateChecker Class

Handles checking for application updates.

Methods

check()

def check(self)
Checks PyPI for the latest version of Nicotine+.
from pynicotine.core import UpdateChecker

checker = UpdateChecker()
checker.check()

Global Instance

from pynicotine.core import core
A global core instance is available for import and provides access to all application components.

Build docs developers (and LLMs) love