--- id: xmod version: "1.10.0" license: MIT license_treatment: permissive maintenance: active --- # xmod — 🌱 Turn any object into a module 🌱 License: permissive · Maintenance: active · Downloads: 4.9M/mo ## What it is and what it does xmod is a lightweight library that lets you give a module the behavior of a callable or container object. Normally, modules are static namespaces; xmod wraps a module so it can respond to function calls, indexing, or other object protocols. This is useful for single-purpose modules where you want to avoid boilerplate and instead call or index the module directly. The package has no runtime dependencies and works with modern Python versions (3.10–3.14). It's maintained actively with no known vulnerabilities. The core use case is simplifying APIs of modules that "just do one thing" by letting them behave like the objects they export. Use it for: - Make a module callable so the module itself can be invoked as a function without intermediate imports. - Wrap a module around a list or dict to support indexing and mutation directly on the module. - Reduce import boilerplate in libraries where the module itself is the primary interface. - Create a module that mimics a built-in type's interface for a more intuitive API. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Lets a module behave like a callable object or container by wrapping it with special methods, eliminating redundant import patterns. Yes, if you want to simplify module APIs or reduce import boilerplate in single-purpose modules. The package is lightweight, actively maintained, permissively licensed, and carries no security vulnerabilities. Install friction is minimal. It's a niche tool, but well-suited to its specific use case. ## Install pip install xmod uv add xmod poetry add xmod ## Installing xmod Before you install: Low install friction with no runtime dependencies. Active maintenance with a recent release 97 days ago and current Python version support (3.10–3.14). License in practice: MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions. Quickstart: pip install xmod import xmod @xmod def a_function(): return 'result' # Module is now callable print(a_function()) # 'result' Requires Python 3.10 or later. Verify before relying: - Whether the decorator approach preserves standard module attributes like __all__ and __doc__. - Performance overhead of the module wrapping mechanism for frequently-accessed modules. - Compatibility with module introspection tools and import hooks. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 4.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags callable modules, module as object, indexable modules, module wrapper, module decorator, module protocol, module metaprogramming, module-protocol, decorator, api-design [View on SkillFed](https://skillfed.io/packages/xmod) · [View on PyPI](https://pypi.org/project/xmod/)