# Disk space minimization for Python distributors

**URL:** <https://discuss.python.org/t/disk-space-minimization-for-python-distributors/5447>\
**Category:** Ideas\
**Created:** [October 14, 2020, 12:38pm UTC](https://discuss.python.org/t/disk-space-minimization-for-python-distributors/5447 "2020-10-14T12:38:25Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![ncoghlan](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/ncoghlan/32/14266_2.png) [@ncoghlan](https://discuss.python.org/u/ncoghlan)\
**Post date:** [October 26, 2020, 3:00pm UTC](https://discuss.python.org/t/disk-space-minimization-for-python-distributors/5447/8 "2020-10-26T15:00:27Z")

</div>

Some variants on option 2 to consider:

- allowing ` __pysource__ ` to contain a metadata file that describes how to obtain the source files, or points to a different directory for them (Note: I dropped the trailing `s` deliberately, as I don’t think it improves the clarify of the name)
- supporting a PYTHONPYSOURCEPREFIX option similar to PYTHONPYCACHEPREFIX to allow parallel trees rather than nested directories

Regarding zipping the entire standard library (from the larger brainstorming doc):  
$ python3 -m site | grep zip  
‘/usr/lib64/python38.zip’,

Compressing the entire stdlib is theoretically supported, so the interpreter includes an entry for it in the default definition of sys.path. Running that way isn’t as well _tested_ as running uncompressed, but it’s expected to work.

---

_[View the full topic](https://discuss.python.org/t/disk-space-minimization-for-python-distributors/5447)._
