Simple import library for Python (not entry-point based)
Go to file
OpenDev Sysadmins 3bb9456d8b OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:50:53 +00:00
simport Add PEP8 check and fix related issues 2015-08-18 14:20:15 -05:00
tests Add PEP8 check and fix related issues 2015-08-18 14:20:15 -05:00
.gitignore Add PEP8 check and fix related issues 2015-08-18 14:20:15 -05:00
.gitreview OpenDev Migration Patch 2019-04-19 19:50:53 +00:00
LICENSE Initial commit 2014-02-13 09:28:19 -08:00
README.md Fixed up docs 2014-05-28 03:42:44 +00:00
requirements.txt Add PEP8 check and fix related issues 2015-08-18 14:20:15 -05:00
setup.cfg Bump dev status 2015-08-18 00:46:23 +00:00
setup.py added setup and tox support 2014-05-23 20:37:26 +00:00
tox.ini Add PEP8 check and fix related issues 2015-08-18 14:20:15 -05:00

README.md

simport

Simple Import Library for Python

Supports importing functions or class methods from files not in the Python Path.

Using Simport

import simport

# For modules already in the Python Path
function = simport.load('mymodule.myfunction')
class_method = simport.load('mymodule:MyClass.mymethod')
klass = simport.load('mymodule:MyClass')  # uninstanstiated.

# For modules not in the Python Path
function = simport.load('/path/to/dir|module_name:myfunction')
class_method = simport.load('/path/to/dir|module_name:MyClass.mymethod')

Look at the tests for some interesting naming conventions for specifying relative modules, etc.

Running Tests

From the simport root directory, run tox