Skip to main content

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.

Release files for stickytape 0.1.2

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

Source distribution (sdist)

Source distribution for stickytape 0.1.2
File Size Uploaded
stickytape-0.1.2.tar.gz 3.5 kB Details

Release files / stickytape-0.1.2.tar.gz

Download URL stickytape-0.1.2.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ac917d879cc970b928623eb6ccaa62b2c33f45d6a5394a17fe1967bc68b88837
BLAKE2b-256 checksum
How to use checksums
c391c318ca14b3cad2324f8c1b20b22c66613038c427351cb482b9ee7374b649
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.2.1

2 release files

0.2.0

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

3 release files

0.1.12

1 release file

0.1.11

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

This release

0.1.2 This release

1 release file

0.1.1

1 release file

0.1.0

1 release file

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