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:
Detection of imports is done using a fairly simple regex. For instance, things will go horribly wrong if you use have two import statements on the same line separated by a semi-colon. Similarly, imports using importlib won’t be detected.
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.
Metadata
Release files for stickytape 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| stickytape-0.1.3.tar.gz | 3.5 kB | Without provenance | Details |
Release files / stickytape-0.1.3.tar.gz
| Download URL | stickytape-0.1.3.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6271ed1ffa18651bf828ff9263b1dc93e518079775671c3384dc87ac65c61046
|
|
BLAKE2b-256 checksum How to use checksums |
d9715eee7f3ea3f40344c965f5ad264ba656d9332a64643da6fd418e25f3e6cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for stickytape 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.