Skip to main content

Dynamic import from files and other sources

Project description

Documentation Status Open Issues PyPI Package Test Health Code Coverage

When you just need that code, include does the ugly bits for you. It allows you to run code from files, strings or other sources as if they were regular modules. Code is executed as compliant as possible with the Python ecosystem. The resulting modules and objects can be pickled, copied and sent to other processes. This makes include suitable for testing, configuration, code creation and more.

Usage

include provides a simple API that works similar to the __import__ builtin. To import a module from its file path, pass it to the include.path function:

import include
conf_module = include.path('/etc/myapp/conf.py')

Once a module has been imported by include, it does not require special handling. You can work with the resulting module and its content without using include explicitly.

note:The include package must be importable by any python process working with a module imported by include.

Installation

The most recent stable version of include is available from pypi. You can install it using pip:

pip install include

Project details


Download files

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

Files for include, version 0.2.2
Filename, size File type Python version Upload date Hashes
Filename, size include-0.2.2-py2.py3-none-any.whl (14.2 kB) File type Wheel Python version 3.6 Upload date Hashes View
Filename, size include-0.2.2.tar.gz (9.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page