Skip to main content
HomePythonDeveloping Python Packages

Developing Python Packages

4.5+
21 reviews
Intermediate

Learn to create your own Python packages to make your code easier to use and share with others.

Start Course for Free
4 Hours14 Videos47 Exercises
14,671 LearnersTrophyStatement of Accomplishment

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.
GroupTraining 2 or more people?Try DataCamp For Business

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.

In the following Tracks

Certification Available

Data Scientist in Python

Go To Track

Python Developer

Go To Track
  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

In the following Tracks

Certification Available

Data Scientist in Python

Go To Track

Python Developer

Go To Track

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

Don’t just take our word for it

*4.5
from 21 reviews
71%
10%
19%
0%
0%
Sort by
  • Viktor V.
    7 months

    Апап

  • Manuel C.
    7 months

    excellent, learned a lot and accomplished exactly what i was after

  • Albert L.
    7 months

    After taking the object Oriented Pregramming , wriitng functions in Python, unit testing for Datascience in Python, I thought I knew all I needed. This showed actual implementation from scratch. Even after having taken thoses other course and thinking I understood how to build there were nuances I got wrong or did not know, This course gives real world example of python package structure of file types , directories and real case uses. I know understand the mystery of the files I see in github repositories. I recommend taking the other courses 1st then this as the capstone.

  • Damilya Z.
    10 months

    Short and clear, great for experienced professionals coming from non-python background.

  • Muhammad A.
    11 months

    This was a good but easy for me to pick. I wish make it more engaging with more real world scenarios. Too much generalization make the content less engaging, but there's a high chance ofy personal bias due to personsal background.

"Апап"

Viktor V.

"excellent, learned a lot and accomplished exactly what i was after"

Manuel C.

"Short and clear, great for experienced professionals coming from non-python background."

Damilya Z.

Join over 14 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.