Skip to main content
Giuseppe Legrottaglie avatar

Giuseppe Legrottaglie has completed

Developing Python Packages

Start course For Free
4 hours
3,900 XP
Statement of Accomplishment Badge

Loved by learners at thousands of companies


Course Description

Do you find yourself copying and pasting the same code between files, wishing it was easier to reuse and share your awesome snippets? Wrapping your code into Python packages can help! In this course, you’ll learn about package structure and the extra files needed to turn loose code into convenient packages. You'll also learn about import structure, documentation, and how to maintain code style using flake8. You’ll then speed up your package development by building templates, using cookiecutter to create package skeletons. Finally, you'll learn how to use setuptools and twine to build and publish your packages to PyPI—the world stage for Python packages.
For Business

GroupTraining 2 or more people?

Get your team access to the full DataCamp library, with centralized reporting, assignments, projects and more
Try DataCamp for BusinessFor a bespoke solution book a demo.
  1. 1

    From Loose Code to Local Package

    Free

    Get your package started by converting scripts you have already written. You'll create a simple package which you can use on your own computer.

    Play Chapter Now
    Starting a package
    50 xp
    Modules, packages and subpackages
    100 xp
    From script to package
    100 xp
    Putting your package to work
    100 xp
    Documentation
    50 xp
    Writing function documentation with pyment
    100 xp
    Writing function documentation with pyment II
    100 xp
    Package and module documentation
    100 xp
    Structuring imports
    50 xp
    Sibling imports
    100 xp
    Importing from parents
    100 xp
    Exposing functions to users
    100 xp
  2. 2

    Install Your Package from Anywhere

    Make your package installable for yourself and others. In this chapter, you'll learn to deal with dependencies, write READMEs, and include licenses. You'll also complete all the steps to publish your package on PyPI—the main home of Python packages.

    Play Chapter Now
  3. 3

    Increasing Your Package Quality

    Bring your package up to a professional standard. Discover how to use pytest to guard against errors, tox to test if your package functions with multiple versions of Python, and flake8 to maintain great code style.

    Play Chapter Now
  4. 4

    Rapid Package Development

    Create your packages more quickly. In this final chapter, you’ll learn how to use cookiecutter to generate all the supporting files your package needs, Makefiles to simplify releasing new versions, and be introduced to the last few files your package needs to attract users and contributors.

    Play Chapter Now
For Business

GroupTraining 2 or more people?

Get your team access to the full DataCamp library, with centralized reporting, assignments, projects and more

Collaborators

Collaborator's avatar
Amy Peterson
Collaborator's avatar
Maggie Matsui

Prerequisites

Introduction to ShellWriting Functions in Python
James Fulton HeadshotJames Fulton

Climate Informatics Researcher

James is a PhD researcher at the University of Edinburgh, where he tutors computing, machine learning, data analysis, and statistical physics. His research involves using and developing machine learning algorithms to extract space-time patterns from climate records and climate models. He has held visiting researcher roles, working on planet-scale data analysis and modeling, at the University of Oxford and Queen's University Belfast and has a masters in physics where he specialized in quantum simulation. In a previous life, he was employed as a data scientist in the insurance sector. When not several indents deep in Python, he performs improvised comedy.
See More

Join over 13 million learners and start Developing Python Packages today!

Create Your Free Account

GoogleLinkedInFacebook

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.