Skip to content
Convert Python packages into a single script
Python Makefile
Branch: master
Clone or download
Pull request Compare This branch is 3 commits ahead, 21 commits behind mwilliamson:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
scripts
stickytape
test_scripts
tests
.gitignore
.travis.yml
CONTRIBUTING.md
LICENSE
MANIFEST.in
README.md
makefile
requirements.txt
setup.py
test-requirements.txt
tox.ini

README.md

stickytape: Convert Python packages into a single script

Stickytape can be used to convert a Python script and any Python modules it depends into a single-file Python script. You can tell stickytape which directories to search using the --add-python-path argument. For instance:

stickytape scripts/blah --add-python-path . > /tmp/blah-standalone

Or to output directly to a file:

stickytape scripts/blah --add-python-path . --output-file /tmp/blah-standalone

You can also point stickytape towards a Python binary that it should use sys.path from, for instance the Python binary inside a virtualenv:

stickytape scripts/blah --python-binary _virtualenv/bin/python --output-file /tmp/blah-standalone

As you might expect with a program that munges source files, there are a few caveats:

  • Anything that relies on the specific location of files will probably no longer work. In other words, __file__ probably isn't all that useful.

  • Any files that aren't imported won't be included. Static data that might be part of your project, such as other text files or images, won't be included.

You can’t perform that action at this time.