What is Python Egg?

Question:

Reading a book about Python, the author shows a command in which it is possible to create an Egg and upload its package to PyPi (official repository of python packages). Basically using the command below:

python setup.py bdist_egg upload --identity="Jon Snow" --sign --quiet

In fact, I didn't understand exactly what this "Egg" would be. Is it just a module? What is Python Egg? How can it actually be used?

Answer:

The .egg file is a distribution format for Python packages. It is just an alternative to a Windows exe or source code distribution. But note that for pure Python, the .egg file is completely cross-platform.

The .egg file itself is essentially a .zip file. If you change the extension to "zip", you can see that it will have folders inside the file.

Read about here: http://mrtopf.de/en/a-small-introduction-to-python-eggs/

You can learn how to create yours here: https://www.blog.pythonlibrary.org/2012/07/12/python-101-easy_install-or-how-to-create-eggs/

Scroll to Top