One of the major powers of open sourced modularised languages like Python is that they have numerous packages that have been built by experts over the years (since 1991). So we really do "stand on the shoulders of giants" in this regard.
Python offers thousands of such modules and each one would take even an expert weeks to master. So we must appreciate that we can only touch the surface of some of the capabilities that these modules offer to the Python language.
"The total number of Python packages in existence exceeds 200,000 (and that figure only includes those stored on PyPI, the official Python Package Index)".
This means that there are more packages than words in the Oxford English Dictionary, although like the English dictionary (with 50,000 obsolete words), there will be many obsolete modules as the ecosystem evolves.
We will try to look at some of the major modules.
the modules are split into 2 categories in python.
inbuilt - come shipped with python
external - installed via a package manager
When we install python, it come shipped with a whole bunch or core modules.
This is already more than enough to keep us busy for a while !
We can see the full list here:
https://docs.python.org/3/py-modindex.html
In the latest python (3.11) alone there are over 300 built in modules, which already provide a huge amount of capability.
The many thousands of external modules are handles by package managers. This site will only touch upon the most powerful (and commonly used) ones, as we have already discussed, it is a huge task (decades of work by very smart and dedicated people).
pip is the package installer for Python. You can use pip to install packages from the Python Package Index and other indexes.
The link to the package manager is here: https://pypi.org/project/pip
It is the PyPA recommended tool for installing Python packages.
There are other package managers such as conda which offer access to the same modules (which we will look at separately).
It is easy to install packages (on windows, linux and mac-os) like this:
C:> python -m pip install sampleproject
[...]
Successfully installed sampleproject
It is also possible o install packages from github or from a distribution file (although i never have).
We can also manage packages or install bunches of packages (with a requirements.txt file).
Everything is made simple and is demonstrated (in the docs) here: https://pip.pypa.io/en/stable/getting-started