A Python package consists of a file folder containing Python modules. Basically, a collection of .py
files. To indicate that a particular file folder is a package, a typically empty file named __init__.py
must be included within the designated package folder. Also, the name of that file folder becomes the name of the package, e.g. ecommerce
. See file directory tree example below. Imagine that both of the __init__.py
files displayed are empty.
parent_directory/
main.py
ecommerce/
__init__.py
database.py
products.py
payments/
__init__.py
square.py
stripe.py