Creating Packages

What's Packages

A python package is a collection of modules. Modules that are related to each other are mainly put in the same package. When a module from an external package is required in a program, that package can be imported and its modules can be put to use.

Best Practice

A package is a directory of Python modules that contains an additional __init__.py file, which distinguishes a package from a directory that is supposed to contain multiple Python scripts. Packages can be nested to multiple depths if each corresponding directory contains its own __init__.py file.

PyPI & PIP

In this article, we will discuss how to access and utilize the Python Package Index or PyPI via the pip command.

PyPI is the default software repository for Python developers to store created Python programming language software developers and programmers alike use to publicize and share their software.

Along with PyPI, the PyPi-Install library enables you to upload Python code to PyPI using just using a single function call. After utilizing this option, you can install a Python library from any terminal using the popular command:

root@host [~]# pip install mylibary 

PyPI itself also simplifies the Python packaging process for Python programs. The specific Pythonpackaging process is noted here.

Last updated