{"id":2580,"library":"lml","title":"lml - Load Me Later","description":"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.","status":"active","version":"0.2.0","language":"en","source_language":"en","source_url":"https://github.com/python-lml/lml","tags":["plugin-management","lazy-loading","extensibility","framework"],"install":[{"cmd":"pip install lml","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"note":"Decorator for registering plugin metadata.","symbol":"PluginInfo","correct":"from lml.plugin import PluginInfo"},{"note":"Base class for managing and retrieving plugins.","symbol":"PluginManager","correct":"from lml.plugin import PluginManager"}],"quickstart":{"code":"from lml.plugin import PluginInfo, PluginManager\n\n@PluginInfo(\"cuisine\", tags=[\"Portable Battery\"])\nclass Boost(object):\n    def make(self, food=None, **keywords):\n        print(f\"I can cook {food} for robots\")\n\nclass CuisineManager(PluginManager):\n    def __init__(self):\n        PluginManager.__init__(self, \"cuisine\")\n\n    def get_a_plugin(self, food_name=None, **keywords):\n        # 'key' is the primary key used during registration, often the first tag\n        return PluginManager.get_a_plugin(self, key=food_name, **keywords)\n\nif __name__ == '__main__':\n    manager = CuisineManager()\n    chef = manager.get_a_plugin(\"Portable Battery\")\n    if chef:\n        chef.make(food=\"Portable Battery\")\n    else:\n        print(\"No chef found for Portable Battery\")","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade to Python 3.x to use lml >= 0.2.0.","message":"lml dropped official support for Python 2 in version 0.2.0. Users on Python 2.x must use an older version of the library.","severity":"breaking","affected_versions":"<=0.1.0"},{"fix":"Clearly define the expected interface (methods, attributes) that all plugins should adhere to for your lml-enabled application.","message":"lml 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).","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}