Python Packaging Cheatsheet

A one-page Python packaging reference, every snippet explained line by line: what makes a folder importable, the core and api split, docstrings, setup.py, editable installs, mirrored tests, and publishing.

A script is a file you run; a package is something other people can install and import, and getting from one to the other is ten small steps rather than one big one. This cheatsheet gathers the whole workflow on one page, from __init__.py and the core-and-api split through docstrings, setup.py, editable installs, testing and publishing, each snippet annotated line by line. Keep it open while you build, or save the image and pin it nearby.

For the full background, read the guide to turning your Python code into a real package. To practise, work through the 10 code-along examples.

Download the cheatsheet

Hope this helps.

View Comments (1)

Leave a Reply

Subscribe to My Newsletter

Subscribe to my email newsletter to get the latest posts delivered right to your email. Pure inspiration, zero spam.

Discover more from Discuss Data Science, Machine Learning and Analytics

Subscribe now to keep reading and get access to the full archive.

Continue reading