Skip main navigation

Module and Package : What are they?

Explore the modules and packages that make up the Python library.

Watch the video to understand how Python has some useful features for keeping your code well organised. This video will give you an overview of modules and packages.

Efficiency is an important objective in writing code. You might not notice the difference in small projects, but as you create larger programs and work with larger data sets, you will see that efficient, well-structured code results in better program performance. Using various features of modules and packages, you can most certainly try to achieve that.

This table below summarises the differences between modules and packages:

Module Package
A module is a file of Python code. A package is a hierarchical file directory structure.
It can define classes, functions, and variables. It defines a single Python application, or library.
It can include runnable code. It consists of various sub-packages and modules.
Example use case: Write a set of functions once and reuse them in many different projects. Example use case: Organise a collection of modules together for accomplishing a particular activity, such as data analytics.
This article is from the free online

Python Packages: NumPy and Pandas Dataframe

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now