Skip to main content

Recursive module importer

Project description

Python  _                     _             _
   _ __(_)__ _ __ _ _  _ _  _| |__  __ _ __| |__
  | '_ \ / _` / _` | || | || | '_ \/ _` / _| / /
  | .__/_\__, \__, |\_, |\_, |_.__/\__,_\__|_\_\
  |_|    |___/|___/ |__/ |__/

Supported Pythons: 2.6+, 3.2+

Python package for finding modules recursively and then importing them. Useful for scripts/libraries which expose DSL-like stuff, like test suites and configuration.

Development goals include extensibility and stability. We aim for a robust API that although doesn’t do much does what it does well. Currently we think that we’ve reached those goals.

from piggyback.finder import Finder
from piggyback.loader import Loader

importer = Loader(Finder('path'))
for module in importer.search():
    print(module)

cache = importer.import_all()
module = cache['path.module']

Let Piggyback manage all the hackery required for you and go write some code. No more manual execfiles and namespace management madness. Piggyback does importing and namespaces right, namely:

  • We isolate every module that we __import__, and their namespaces are separate of one another, as well as the current module. No namespace clashes.
  • The sys.path variable remains unchanged at the end of the importing- Piggyback will ensure that the sys.path is cleansed of all appended paths once we are finished with the importing.

To install the current version of the package, simply do a pip install piggyback. For the documentation you can simply visit the docs on Github pages.

https://travis-ci.org/eugene-eeo/piggyback.svg?branch=master

Project details


Release history Release notifications

This version
History Node

0.1.2

History Node

0.1.1

History Node

0.1

History Node

0.1-beta

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
Piggyback-0.1.2.tar.gz (3.8 kB) Copy SHA256 hash SHA256 Source None Aug 19, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page