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.

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:

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

    FAQ

    • Troubleshooting

About the instructors