Creating and Distributing Python Packages

Everything you need to know to create installable Python packages.

Do you have a script, function, or even a snippet of Python code you copy from project to project? Rather than copying this little bit of Python code, have you ever considered just releasing your code on the Python Package Index (PyPI)? That way you can add tests, documentation, and even get some help on your code. Sounds wonderful, right?

The downside of releasing something on PyPI is that it's not easy. There are a lot of finicky boilerplate files that go into a Python package. While pretty well documented, it's not easy and even the best Python coders often copy/paste the boilerplate code from one project to another. They do this because trying to work through finicky boilerplate simply isn't as productive as creating new packages from existing snippets of code.

This course is the answer to learning how to quickly overcome getting around finicky boilerplate. It will introduce you to a number of useful concepts and a wonderful tool called Cookiecutter.

Support Open Source

The people behind this course are avid members of the open source community. They are creators or maintainers of numerous packages within the Python ecosystems. Their code is used by tens of thousands of software developers around the world.

By taking this course, you are helping to enable the authors to continue working on various open source projects that help drive the modern Python ecosystems. You will be supporting the open source ecosystem that creates and supports the tools that provide us with employment today.

Who should participate

If you're comfortable writing simple Python scripts or programs, you should be fine.

Knowledge of Python past the "Hello World" basics is recommended. If you've never done a Python tutorial before, you should probably do one and practice writing Python scripts before joining this course.

Prerequisites

We assume the following of those taking this course:

  • You have Python 2.7.x or 3.4 (or higher) installed.
  • You have pip and virtualenv installed. conda can also be used, as can pipenv.
  • You know how to write Python code.
  • You probably have a snippet of code that you copy from place to place.

What will you do during the course?

You will:

  • Take a bit of code that you've written, be it a module, function, class, or even a snippet, and turn it into a package that will be uploaded onto PyPI.
  • Install Cookiecutter.
  • Use Cookiecutter to generate Python package boilerplate.
  • Put your code into the package.
  • Add two useful tests.
  • Create an account on PyPI if you don't have one yet.
  • Upload your Python package onto PyPI.
  • Use pip or conda to check if your Python package installs locally.
  • Learning how to use Tox to test your project against multiple versions of Python
  • Employing continuous integration for running tests via Travis CI and uploading documentation into Read the Docs
  • Share with your friends and colleagues your Python package
  • Have lifetime access to the course!


What others have been saying about this course:

Nick Mavrakis

Very well structured educational course on a hot topic

Although I didn't attend in person but remotely (from Greece), the tutorial material was terrific. Right into the point. I learned best practices (and still do), plus the community is amazingly helpful and willing to assist you with any kind of ...

Sagar Giri

Just love it.

This course is the best. It is so detail oriented and even a novice Python programmer can understand the course content and easily execute the steps provided in the course. I personally learned a lot. Not only about packaging and distribution but ...

Andy Venet

Awesome course

I really appreciate the opportunity to take this course, I have learned a lot. You guys rock!!

What's included?

5 Quizzes
4 Surveys
30 Texts
8.0
Daniel and Audrey Roy Greenfeld
Daniel and Audrey Roy Greenfeld

About the instructors

Daniel and Audrey Roy Greenfeld are co-authors of the Two Scoops of Django: Best Practices for the Django Web Framework books. Together or individually they started numerous popular open source or community projects and have given keynote speeches at conferences on four continents. They met at PyCon US in 2010 and were married in 2013.

Fluencies: English, Spanish

Daniel has worked for NASA, the US Navy, EventBrite, and leading consulting firms such as Cartwheel Web, Revolution Systems, and Eldarion. He has created or co-created many popular open source projects such as django-crispy-forms, cached-properties, djangopackages.org, and Cookiecutter Django. 

Audrey has a degree in Electrical Engineering and Computer Science from MIT and has worked for Microsoft, Sharpcast, not to mention leading consulting firms such as Cartwheel Web and Revolution Systems. She has created popular open source projects, such as Cookiecutter, Cookiecutter PyPackage, and Favicon Cheat Sheet. She also co-created djangopackages.org.


Diane Chen
Diane Chen

Diane has a B.A. and M.S. in Computer Science from San Diego State University. She also has C++ and Java certificates from the UC San Diego Extension, and a Python certificate from Coursera. She has 20+ years of experience programming Engineering CAD/CAM software, has built many websites and has worked in hardware testing. Currently she is enamored with the Python programming language and teaches UC San Diego Extension, workshops and private courses. 

Additionally, Diane contributes to open source software, is active in the local Python and PyLadies groups and is an organizer and coach for DjangoGirls workshops in Southern California.

What are you waiting for?

Sign up now!