Package your python code into one zip file, even a virtual environment.
Project description
zipapps ![PyPI](https://pypi-camo.freetls.fastly.net/fdd190c5f9d73d0fd5b2683c8cb503df65302eed/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f7a6970617070733f7374796c653d706c6173746963)
![GitHub Workflow Status](https://pypi-camo.freetls.fastly.net/cd150353a7fdb29af3a0b11e20d239d4df12fc52/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f636c6572696370792f7a6970617070732f507974686f6e2532307061636b6167653f7374796c653d706c6173746963)
![PyPI - Wheel](https://pypi-camo.freetls.fastly.net/20b6a42c5fcf5544010bddaed88b04bba09481eb/68747470733a2f2f696d672e736869656c64732e696f2f707970692f776865656c2f7a6970617070733f7374796c653d706c6173746963)
![PyPI - Python Version](https://pypi-camo.freetls.fastly.net/3834735d54ad9d121f2616fc8187c8a80c0d76a9/68747470733a2f2f696d672e736869656c64732e696f2f707970692f707976657273696f6e732f7a6970617070733f7374796c653d706c6173746963)
![PyPI - Downloads](https://pypi-camo.freetls.fastly.net/8e627ad180b1bb0fcb1667861996443046e0460a/68747470733a2f2f696d672e736869656c64732e696f2f707970692f646d2f7a6970617070733f7374796c653d706c6173746963)
![PyPI - License](https://pypi-camo.freetls.fastly.net/260a4d74718f2631f37dae423d23652f2c1fae0d/68747470733a2f2f696d672e736869656c64732e696f2f707970692f6c2f7a6970617070733f7374796c653d706c6173746963)
Package your python code into one zip file, even a virtual environment. Also compatible for win32.
Inspired by shiv, to publish applications easily. Unlike shiv, this lib will not create cache folders while running apps.
Requirements
Only python3.6+
Install
pip install zipapps -U
Usage
python3 -m zipapps -h
0. package your code without any requirements
> python3 -m zipapps -c -a ./simple_package -p /usr/bin/python3 -o simple_package.pyz
> ./simple_package.pyz
OR
> python3 -m zipapps -c -a ./simple_package -o simple_package.pyz
> python3 simple_package.pyz
------------------------------------
1. use zipapps to make a standalone app which need bottle installed
> python3 -m zipapps -c -a bottle_server.py -m bottle_server:main bottle
> python3 app.pyz
OR
> python3 -m zipapps -c -a bottle_server.py -m bottle_server:main bottle
> python3 app.pyz
------------------------------------
2. use zipapps for venv
> python3 -m zipapps -c bottle
> python3 app.pyz bottle_server.py
OR
> python3 -m zipapps -c -p /usr/bin/python3 bottle
> ./app.pyz bottle_server.py
------------------------------------
3. advanced usages
3.1 more args
python3 -m zipapps -c -a package1,package2 -o server.pyz -m package1.server:main -p /usr/bin/python3 -r requirements.txt
./server.pyz
PS: all the unknown args will be used by "pip install".
===========================================================================
optional arguments:
-h, --help show this help message and exit
--output OUTPUT, -o OUTPUT
The name of the output file, defaults to "app.pyz".
--python INTERPRETER, -p INTERPRETER
The name of the Python interpreter to use (default: no shebang line).
--main MAIN, -m MAIN The main function of the application. Format like package.module:function.
--compress, -c Compress files with the deflate method, defaults to uncompressed.
--includes INCLUDES, -a INCLUDES
The files/folders of given dir path will be copied into cache-path, which can be import from PYTHONPATH). The path string will be splited by ",".
--cache-path CACHE_PATH
The cache path of zipapps to store site-packages and `includes` files, which will be treat as PYTHONPATH. If not set, will create and clean-up automately.
--shell Only while `main` is not set, used for shell=True in subprocess.Popen
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for zipapps-2020.10.20-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92ffd99716de9c87c60b5824766e6d138d0ce22525fb1b49ea0ded6acb5657bf |
|
MD5 | 3253181b598ecfe81cdff4a1eca68ccb |
|
BLAKE2b-256 | 2856e514679c957e8118064ee6b32b8f1438aa2c91fdab14b5f53d8b011c37fc |
Close
Hashes for zipapps-2020.10.20-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b83ae4eb0dc246cdeba4d967eca074f9623ec9527021022b18749176e76d4c45 |
|
MD5 | 4f92d7b9301f9ee0453f96ffb8415c2a |
|
BLAKE2b-256 | fe2068849b12d6d44c2b587b173092e1c075968d3d67e424ac9cf33e21d00d4d |