All the Ways to Compress and Archive Files in Python
towardsdatascience.com
towardsdatascience.com
This means that you can zip your entire project, including deps, into a pyz file, and ship that to your serveur as one big archive and run it like you would a .py file. It makes deployments very easy.
It also means you don't have to worry about using dependancies in quick scripts: use as many as you want and bundle them!
A tool exists to create the bundle easily and make it extract itself on first run for better perfs:
Is that instead of the zipapp module.
Edit: Answered by first question: https://docs.python.org/3/library/zipapp.html#creating-stand...
https://shiv.readthedocs.io/en/latest/
https://pex.readthedocs.io/en/v2.1.49/
You still need the host to have a base python interpreter.
https://python-zstandard.readthedocs.io/en/latest/
https://engineering.fb.com/2016/08/31/core-data/smaller-and-...
The compression ratio and decompression speed just blow everything else away.