Logic Management¶
The logic package provides the main interface for plugin management and search functionality.
Logic Class¶
Main Logic Pro plugin management interface.
This module provides the Logic class, the primary entry point for discovering and managing Logic Pro’s audio plugins and their categorization.
- class logic_plugin_manager.logic.logic.Logic(*, components_path: Path | str = None, tags_path: Path | str = None, lazy: bool = False)[source]¶
Bases:
objectMain interface for Logic Pro plugin and category management.
Provides high-level operations for discovering plugins, managing categories, and bulk category assignments.
- Parameters:
components_path (Path)
tags_path (Path)
lazy (bool)
- musicapps¶
MusicApps instance for database access.
- plugins¶
Plugins collection with search capabilities.
- components¶
Set of discovered Component bundles.
- categories¶
Dictionary of category name to Category instance.
- components_path¶
Path to Audio Components directory.
- tags_path¶
Path to tags database directory.
- __init__(*, components_path: Path | str = None, tags_path: Path | str = None, lazy: bool = False)[source]¶
Initialize Logic plugin manager.
- Parameters:
components_path (
Path|str) – Custom path to Components directory.tags_path (
Path|str) – Custom path to tags database.lazy (
bool) – If True, skip automatic discovery.
Note
If lazy=False, automatically calls discover_plugins() and discover_categories() which may raise various exceptions.
- tags_path: Path = PosixPath('/home/docs/Music/Audio Music Apps/Databases/Tags')¶
- components_path: Path = PosixPath('/Library/Audio/Plug-Ins/Components')¶
- discover_plugins() Logic[source]¶
Scan components directory and load all plugins.
Iterates through .component bundles, loading their AudioComponents into the plugins collection. Failed components are logged as warnings.
- Returns:
Self for method chaining.
- Return type:
- discover_categories() Logic[source]¶
Load all categories from the MusicApps database.
- Returns:
Self for method chaining.
- Return type:
- Raises:
MusicAppsLoadError – If database files cannot be loaded.
- search_categories(query: str) set[Category][source]¶
- Return type:
set[Category]- Parameters:
query (str)
- add_plugins_to_category(category: Category, plugins: set[AudioComponent]) Logic[source]¶
- Return type:
- Parameters:
category (Category)
plugins (set[AudioComponent])
- move_plugins_to_category(category: Category, plugins: set[AudioComponent]) Logic[source]¶
- Return type:
- Parameters:
category (Category)
plugins (set[AudioComponent])
- remove_plugins_from_category(category: Category, plugins: set[AudioComponent]) Logic[source]¶
- Return type:
- Parameters:
category (Category)
plugins (set[AudioComponent])
Plugins Collection¶
Plugin collection management and search functionality.
This module provides the Plugins class for storing, indexing, and searching AudioComponent instances with various query strategies including fuzzy matching.
- class logic_plugin_manager.logic.plugins.Plugins[source]¶
Bases:
objectCollection of plugins with indexed search capabilities.
Maintains multiple indexes for fast lookups by various attributes and provides fuzzy search functionality using rapidfuzz.
- add(plugin: AudioComponent, *, lazy: bool = False) Plugins[source]¶
Add a plugin to the collection.
- Parameters:
plugin (
AudioComponent) – AudioComponent to add.lazy (
bool) – If True, skip indexing (call reindex_all later).
- Returns:
Self for method chaining.
- Return type:
- get_by_full_name(full_name: str) AudioComponent | None[source]¶
- Return type:
AudioComponent|None- Parameters:
full_name (str)
- get_by_manufacturer(manufacturer: str) set[AudioComponent][source]¶
- Return type:
set[AudioComponent]- Parameters:
manufacturer (str)
- get_by_name(name: str) AudioComponent | None[source]¶
- Return type:
AudioComponent|None- Parameters:
name (str)
- get_by_manufacturer_code(manufacturer_code: str) set[AudioComponent][source]¶
- Return type:
set[AudioComponent]- Parameters:
manufacturer_code (str)
- get_by_factory_function(factory_function: str) set[AudioComponent][source]¶
- Return type:
set[AudioComponent]- Parameters:
factory_function (str)
- get_by_type_code(type_code: str) set[AudioComponent][source]¶
- Return type:
set[AudioComponent]- Parameters:
type_code (str)
- get_by_subtype_code(subtype_code: str) set[AudioComponent][source]¶
- Return type:
set[AudioComponent]- Parameters:
subtype_code (str)
- get_by_tags_id(tags_id: str) AudioComponent | None[source]¶
- Return type:
AudioComponent|None- Parameters:
tags_id (str)
- get_by_category(category: str | None) set[AudioComponent][source]¶
- Return type:
set[AudioComponent]- Parameters:
category (str | None)
- search_simple(query: str) set[AudioComponent][source]¶
- Return type:
set[AudioComponent]- Parameters:
query (str)
- search(query: str, *, use_fuzzy: bool = True, fuzzy_threshold: int = 80, max_results: int | None = None) list[SearchResult][source]¶
Search for plugins with scoring and fuzzy matching.
Searches across multiple fields (name, manufacturer, category, type codes) with relevance scoring. Higher scores indicate better matches.
- Parameters:
query (
str) – Search query string.use_fuzzy (
bool) – Enable fuzzy matching (requires rapidfuzz package).fuzzy_threshold (
int) – Minimum fuzzy match score (0-100).max_results (
int|None) – Limit number of results (None for unlimited).
- Returns:
Sorted search results (highest score first).
- Return type:
list[SearchResult]
- Raises:
ImportError – If use_fuzzy=True but rapidfuzz is not installed.
- class logic_plugin_manager.logic.plugins.SearchResult(plugin: AudioComponent, score: float, match_field: str) None[source]¶
Bases:
objectResult from a plugin search with relevance scoring.
- Parameters:
plugin (AudioComponent)
score (float)
match_field (str)
- plugin¶
The matched AudioComponent instance.
- score¶
Relevance score (higher is better).
- match_field¶
Field that matched (e.g., ‘name’, ‘manufacturer’).
- plugin: AudioComponent¶
- score: float¶
- match_field: str¶
- __init__(plugin: AudioComponent, score: float, match_field: str) None¶
- Parameters:
plugin (AudioComponent)
score (float)
match_field (str)
- Return type:
None