This course is unsupported. It will receive no further upgrades, nor is anyone available to answer questions.

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.


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:

5 star rating

Very well structured educational course on a hot topic

Nick Mavrakis

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 stil...

Read More

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 problem. I learned how to upload a package to Python Package Index (PyPI) with best practices. I recommend it to anyone concerning to contribute to the Python community with small/medium/big packages, not only newbies, but advanced users too. Thank you!

Read Less
5 star rating

Just love it.

Sagar Giri

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...

Read More

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 also the underlying technology and tools that are required to execute the tasks. Thank you Two Scoops Press for this amazing course.

Read Less
5 star rating

Awesome course

Andy Venet

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

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

Read Less

Course Curriculum

  • 1

    Welcome to the course!

    • A Message from the Instructors

  • 2

    1. Planning

    • 1.1 Choosing What to Package

    • 1.2 Naming and Describing Your New Package

    • 1.3 Quiz: Planning and Naming Your Package

    • 1.4 Survey: Tell Us About Your Planned Python Package

  • 3

    2. Installing Tools and Creating Accounts

    • 2.1 Checking Your Setup

    • 2.2 Installing Cookiecutter

    • 2.3 Registering With PyPI

    • 2.4 Creating a GitHub Account

    • 2.5 Quiz: About Your Setup

  • 4

    3. Your First Release: Putting It All Together

    • 3.1 Creating a Skeleton Python Package

    • 3.2 Configuration

    • 3.3 Adding Code

    • 3.4 Dependencies

    • 3.5 Build the Docs

    • 3.6 Fill Out the Starter Docs

    • 3.7 Releasing Your Package

    • 3.8 Quiz: Your First Release

    • 3.9 Survey: Tell Us About Your Python Package

  • 5

    4. Your Second Release: Getting the Details Right

    • 4.1 Tests

    • 4.2 Tox

    • 4.3 Code Style

    • 4.4 Continuous Integration

    • 4.5 Release a Package Update

    • 4.6 Dependency and Security Checks

    • 4.7 Quiz: Your Second Release

    • 4.8 Survey: Your Second Release

  • 6

    5. Your Third Release: Polish and Improvement

    • 5.1 Adding a Command Line Interface (CLI)

    • 5.2 Read the Docs Setup

    • 5.3 Test Coverage

    • 5.4 Makefile

    • 5.5 Release a Package Update

    • 5.6 Further Development

    • 5.7 Quiz: Your Third Release

    • 5.8 Survey: Your Third Release

  • 7

    6. Advanced Topics

    • 6.1 Advanced Topics

    • 6.2 Pipenv

    • 6.3 Installing Old Python Versions

  • 8


    • Troubleshooting

About the instructors

Daniel and Audrey Roy Greenfeld

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, SpanishDaniel 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,, 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

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.