Registry / devops / lml
library0.2.0pypypi✓ verified 24d ago

lml is a Python library that provides a lazy plugin management system. It seamlessly finds lml-based plugins in the Python environment but loads them only on demand, making it suitable for plugins with bulky or memory-hungry external dependencies. The current version is 0.2.0, with releases occurring periodically, the latest being March 2025.

pip install lml
INSTALL
IMPORT
SIG · LML
L
lml
devopspythonv0.2.0
Install
1.5s avg
Import
26ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.028s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.024s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PluginInfo
from lml.plugin import PluginInfo
Decorator for registering plugin metadata.
PluginManager
from lml.plugin import PluginManager
Base class for managing and retrieving plugins.

This example demonstrates how to define a plugin using `PluginInfo` and manage it with a custom `PluginManager`. It registers a 'Boost' plugin under the 'cuisine' category with the tag 'Portable Battery', and then retrieves and uses it.

from lml.plugin import PluginInfo, PluginManager @PluginInfo("cuisine", tags=["Portable Battery"]) class Boost(object): def make(self, food=None, **keywords): print(f"I can cook {food} for robots") class CuisineManager(PluginManager): def __init__(self): PluginManager.__init__(self, "cuisine") def get_a_plugin(self, food_name=None, **keywords): # 'key' is the primary key used during registration, often the first tag return PluginManager.get_a_plugin(self, key=food_name, **keywords) if __name__ == '__main__': manager = CuisineManager() chef = manager.get_a_plugin("Portable Battery") if chef: chef.make(food="Portable Battery") else: print("No chef found for Portable Battery")
Debug
Known issues
breakinglml dropped official support for Python 2 in version 0.2.0. Users on Python 2.x must use an older version of the library.
fix
Upgrade to Python 3.x to use lml >= 0.2.0.
affects: <=0.1.0
gotchalml provides the plugin management system but does not dictate the plugin interface. Developers are responsible for defining their own plugin interfaces (e.g., base classes or expected methods for plugins).
fix
Clearly define the expected interface (methods, attributes) that all plugins should adhere to for your lml-enabled application.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'lml'
The 'lml' package is not installed in your Python environment.
fix
pip install lml
ImportError: cannot import name 'scan_plugins_regex' from 'lml.loader'
This typically occurs due to an incompatibility between the installed version of 'lml' and a library that depends on it (e.g., 'pyexcel-io'), where the dependent library expects a different API or an older 'lml' version is installed.
fix
Ensure that 'lml' and its dependent libraries are compatible. Try upgrading both 'lml' and the problematic dependent library (e.g., 'pip install --upgrade lml pyexcel-io') or installing a specific compatible version if known.
AttributeError: 'PluginName' object has no attribute 'method_name'
This error arises when a plugin managed by 'lml' is either not correctly loaded, registered, or the object returned by the plugin does not have the expected method or attribute, often due to an outdated plugin interface or a misconfigured plugin.
fix
Verify that your plugin adheres to the expected interface defined by your 'lml'-enabled application. Check plugin registration and ensure the plugin's class or function provides the 'method_name' being accessed. Update or reconfigure the plugin if necessary.
Upgrade
Version history
0.2.0latest on PyPI · released Mar 16, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
3 hits · last 30 days
node
2
Resources
lml — pip install lml · libregistry