Skip to content
/ smuggler Public

Sidestep import and load Python files as relative paths

License

Notifications You must be signed in to change notification settings

fny/smuggler

Repository files navigation

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, smuggler 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 smuggler, then:

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

About

Sidestep import and load Python files as relative paths

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages