Skip to main content
HomePython

Developing Python Packages

4.6+
25 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 exercises16,646 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.
Group

Training 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

Training 2 or more people?

Get your team access to the full DataCamp platform, including all the features.
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

Training 2 or more people?

Get your team access to the full DataCamp platform, including all the features.

In the following Tracks

Certification Available

Data Scientist in Python

Go To Track

Python Developer

Go To Track

collaborators

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

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.6
from 25 reviews
76%
8%
16%
0%
0%
  • Stephen H.
    22 days

    Excellent course. Super important skills for Python users of any level to be able to share and collaborate with other users. One of the most important, if not the most important, Python course that I have taken.

  • Ramon C.
    23 days

    The course is very good and comprehensively covers what you need to create good packages in Python

  • Sety L.
    about 1 month

    The course was pragmatic with a lot of coding examples and useful in the real world.

  • Andrés P.
    4 months

    Outstanding course, now I understand how packages work

  • Liam C.
    6 months

    This has been my favourite DataCamp course so far. The instructor communicated very well, and the example Package felt relevant and easy to understand how this would relate to real world projects. The best DataCamp course so far. It was also great to get hands on with the online IDE.

"Excellent course. Super important skills for Python users of any level to be able to share and collaborate with other users. One of the most important, if not the most important, Python course that I have taken."

Stephen H.

"The course is very good and comprehensively covers what you need to create good packages in Python"

Ramon C.

"The course was pragmatic with a lot of coding examples and useful in the real world."

Sety L.

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