Package

noun

say it: “PAK-ij” /ˈpækɪdʒ/

A folder of related Python modules you can import from, often shared online for anyone to install with pip.

What is a package in Python?

A package is a folder of related modules you can import from. Many packages are shared online for anyone to install.

# shop/
#   __init__.py
#   cart.py
#   payments.py

from shop.cart import add_item

In a sentence

  • “The shop package holds cart.py and payments.py, and the app imports from both.”
  • “requests is a package you install with pip.”

Level: Journeyman · More Python terms at this level

Updated

In other subjects