This post explains what are modules in Python and summarizes some popular libraries.
Explaining Python Modules
Python modules allow to add to your computer libraries, functionalities and tools already done, tested and provided by others. This enables reusability of code, and avoid having to develop your own tools and functionalities when someone else (or yourself previously) have already developed them and made them available.
Python modules can be imported to our computer using Package Installer for Python (PIP). Its command-line executable is ‘pip’.
You can install Python on a apt-compatible OS by typing in a terminal:
sudo apt install python3-pip
Types of Python Modules
Types of Python modules:
- Standard
- Third-party
Standard or built-in Python modules are those that because of its frequent use and stability are installed with default Python installation.
Third-party Python modules are those that are not that frequently used or are still under development.
Standard modules are less frequently updated than third-party modules; this is why standard libraries are not adequate for still evolving products.
Looking up Modules
You may have a look at the Python 3 official documentation in the search for built-in modules:
https://docs.python.org/3/library/
You may find list all functions within a module by typing from Python interpreter:
dir(module)
You can also check information about a function within the module by typing on Python interpreter:
help(module.function)
There is a website called Python 3 Module of the Week that features all built-in modules plus some of third-party modules. You can find this website on this external link.
List of common Python Modules
This sections summarizes some popular Python modules or libraries by category.
Data Visualization Python Modules
Data Visualization Python Modules
- Matplotlib
- Plotly
Game Development Python Modules
Games can be developed using Python programming languages, and there are dedicated Python modules for game development.
There are some Python modules dedicated to games development:
- Pygame / PyGame Zero
- Pyglet
- Arcade
- RetroGameLib (based on Pygame)
- Panda3D
- Ursina (based on Panda3D)
You can find more information about Pygame on this post.
Python game dev modules allow to create basic computer games, but they are quite limited or low-level compared to other solutions. If you are looking to develop commercial, AAA, III or advanced video games, you would better have a look at popular video game development engines on this post.
You can find a more extended list of game development python modules on this external link.
Graphical User Interface (GUI) Python Modules
There are different Python modules available that provide graphical user interfaces:
- Free
- tkinter (standard GUI)
- wxPython (simpler but not simplest)
- PySimpleGUI (simplest)
- Kivy (for touch screens)
- Libavg (for touch screens)
- Commercial
- PyQt5
- PySide 2
Standalone App Generator Python Modules
There are different Python modules to create a standalone executable file:
- PyInstaller. Allows to create a Python standalone app for Windows, macOS and Linux. PyInstaller is available from PIP. You may need to install Microsoft Visual C++ Redistributable on Windows because of the use of shared libraries by the application. You can find more info about on this external link.
- py2app. Creates apps for macOS.
- py2exe. Creates apps for Windows OS.
Web Development Python Modules
Web development Python modules:
- Django
PDF Modules
PDF modules:
- PyPDF2
- pdfplumber
- Tabula
- PyMuPDF