Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/graysonarts/little-module-loader
a little library for loading modules dynamically
https://github.com/graysonarts/little-module-loader
Last synced: about 2 months ago
JSON representation
a little library for loading modules dynamically
- Host: GitHub
- URL: https://github.com/graysonarts/little-module-loader
- Owner: graysonarts
- Created: 2012-09-24T20:24:24.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-10-01T20:36:18.000Z (about 12 years ago)
- Last Synced: 2024-04-16T01:01:17.575Z (8 months ago)
- Language: Python
- Size: 129 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
little-module-loader
====================a little library for loading modules dynamically
[![Build Status](https://secure.travis-ci.org/RussTheAerialist/little-module-loader.png)](http://travis-ci.org/RussTheAerialist/little-module-loader)
[![endorse](http://api.coderwall.com/russtheaerialist/endorsecount.png)](http://coderwall.com/russtheaerialist)
Example Usage
=============Finding modules based on filename:
import little.module_loader
parent = "petit"
# this returns a dictionary that maps name of module (without parent) and the actual module object
dict(little.module_loader.find(parent, lambda x: x.endswith("_subsystem.py")))Finding all classes that are subclasses of another class:
# this returns a dictionary that maps the name of the class to the class object for instantiation
dict(class_finder("petit.packets", Packet))View the rest of the documentation here: http://packages.python.org/little.module_loader/