Skip to main content

Sidestep import and load Python files as relative paths

Project description

Build Status Smuggler on PyPI

Sidestep import and load Python files as relative paths.

Intended for one-off imports (e.g. global configuration). Currently, thesmuggler can’t import files that import other local packages, but you can smuggle files that have already smuggled other files.

Tested and working on Python 2.7 and up.

Usage

pip install thesmuggler, then:

from thesmuggler import smuggle

# À la `import weapons`
weapons = smuggle('weapons.py')

# À la `from contraband import drugs, alcohol`
drugs, alcohol = smuggle('drugs', 'alcohol', source='contraband.py')

# À la `from contraband import drugs as dope, alcohol as booze`
dope, booze = smuggle('drugs', 'alcohol', source='contraband.py')

Project details


Download files

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

Source Distribution

thesmuggler-1.0.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

thesmuggler-1.0.1-py2.py3-none-any.whl (3.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file thesmuggler-1.0.1.tar.gz.

File metadata

  • Download URL: thesmuggler-1.0.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for thesmuggler-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9c8e6942626dd69cfd6beb6ef577232646a3af21d829f67273cec30d5b15b689
MD5 9405367db90ec1860189697e33eafc65
BLAKE2b-256 070201179d6b54d13b6509dd78040d6ee5548dc9e5a86e8704bd7a9f4ab1af02

See more details on using hashes here.

File details

Details for the file thesmuggler-1.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for thesmuggler-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d153131355aa0a53e2e124c40e777413397c7960966b0d006699f66ffb7f90d0
MD5 4bcca56b3c7ee5a367506e133436da37
BLAKE2b-256 c19741b17caf76c6019479f3dbda3f374eaaa9cc5b2ef0a2158027263146a070

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page