Skip to main content

The Smuggler 🚬

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')

Metadata

Release files for thesmuggler 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thesmuggler 1.0.1
File Size Uploaded
thesmuggler-1.0.1.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for thesmuggler 1.0.1
File Interpreter ABI Platform
thesmuggler-1.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 7.0 kB

Release files / thesmuggler-1.0.1.tar.gz

Download URL thesmuggler-1.0.1.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9c8e6942626dd69cfd6beb6ef577232646a3af21d829f67273cec30d5b15b689
BLAKE2b-256 checksum
How to use checksums
070201179d6b54d13b6509dd78040d6ee5548dc9e5a86e8704bd7a9f4ab1af02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / thesmuggler-1.0.1-py2.py3-none-any.whl

Download URL thesmuggler-1.0.1-py2.py3-none-any.whl
Size 3.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d153131355aa0a53e2e124c40e777413397c7960966b0d006699f66ffb7f90d0
BLAKE2b-256 checksum
How to use checksums
c19741b17caf76c6019479f3dbda3f374eaaa9cc5b2ef0a2158027263146a070
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page