A wheel is called a binary package because it is targetted to a specific architecture and can contain binary library. But those binary libraries are built from C source code, not from Python. For the rest, a whl file is just a zip file having a special structure, which means that it is enough to unzip it to directly read all the Python files, because it contains all what is required for the project, those pre-compiled binary objects and the Python source code (thanks to Thom Wiggers for noticing).
That being said, a .whl file is a useful package format that can be built with setuptools
and its bdist_wheel
extension. When both are installed you use:
python setup.py bdist_wheel
with an appropriate setup.py
.
A full explaination would be far beyond what can be written in a SO answer, so if you want to go that way, I can only advise you to read the Python Packaging User Guide, specifically the Tool recommendations guide and the Packaging and distributing projects guide