3. Creating Portable Tools: Packaging Your Figure Creation Toolbox#

In this section#

We will learn how to create and publish our visualization toolbox so that we can use it everywhere. Along the way, we will encounter some of the most common issues that arise when creating a package and how to solve them.

This is a hands-on section with a live review of projects.

We’ll review:

Python packages#

We all know that Python comes with batteries included, but what if someone else wants to use the batteries you have created? Creating a Python package is the easiest way to share your code with others. A Python package is a collection of modules that can be easily distributed and installed.

One of the best and shortest introductions to Python packaging is “How to Publish an Open-Source Python Package to PyPI” by Geir Arne Hjelle. In this section, we’ll explore the “ChartCruftHub” repository and learn how to use it as a template for creating our own package.

Summary#

We’ve learned how to create and publish a Python package to PyPI.