×

Python Modules List

Python is like an ocean. If you have been working with Python, you might’ve already heard the word module. When we solve a problem in mathematics, there will be several methods to solve the problem. But, one method will be the best one, and it will be based on the time to solve, simplicity, and accuracy. While programming, programmers also need such solutions. When a programmer first tries to solve a problem, he uses all the methods and analyzes the best method considering many factors and scenarios. The program can be lengthy. In Python, all such programs that a typical Python-programmer will need while coding is stored in modules. So, a module is a file with a set of functions, classes, variables, and statements with logic that we can include in our programs. The programmer need not write the whole code, instead he can include the already developed modules and can use the functionality.

Important points:

  1. Related logics are grouped simultaneously and placed into a file called the modules. Hence, every module consists of similar codes. This improves the organization of a code when we use the modules in our program.
  2. To use the logic specified inside a module in our code, we need to import the module using the import statement for the interpreter to recognize and implement the logic.
    Syntax:

    import module_name
  3. When we import a module into our program, the whole module will be imported. To directly import a function inside the module, we can use the syntax:
    import module_name. function_name
    or
    from module_name import function_name
  4. If we want to import all the functions, variables, and constants of a module, we can use an asterisk:
    from module_name import *
  5. If the module specified by the user does not exist, the interpreter raises an error ImportError: No module named “module_name."
  6. We can even create custom modules by importing the file in which the function or the logic we need is written into any program.

This is the basic idea of modules. Now, let us see the list of modules a programmer will need in his programming journey one or the other time. There are about 200 modules in Python, varying with the distribution. These modules are organized in alphabetical order on the official website - here.

These are some frequently used modules and libraries in Python:

ModuleUse
NumpyIt provides us with several multi-dimensional array processing functions.
PandasThe best library of modules with data analysis, data science, and machine learning solutions.
MatplotlibContains data visualization and plotting functions and is an extension to the numpy library.
SeabornIt is based on matplotlib. Also used for plotting graphs to visualize the vast amount of data.
Scikit-learnBest library for machine learning applications. Contains a lot of tools for statistics and ml.

More modules:

MathCmathUuidPyGtkPsycoVisual Python
PyperclipItertoolsIpaddressPyQtPyInstallerDjango
EmojiBisectGettextTkinterPy2appWeb2py
HowdoiStatPickleWxPythonPyObjCFlask
WikipediaLoggingRePyjamasDesktopPyWin32PyQuery
AntigravityHtmlCopyPySimpleGUIPy2exeOpenflow
UrllibWebbrowserfunctoolsPILPyXGoflow
TurtleftplibPygamePyqtgraphSciPyPyIMSL

Modules vs. Libraries vs. Packages:

When searching for modules, we might run into many libraries and packages. These three words are used synonymously sometimes. But, these are not the same words.

ModulesLibrariesPackages
A simple Python file ends with a .py extension.Collection of already compiled programs to execute in our codes.Collection of similar modules in one place.

A module is a base here. These are normal Python files that contain some code. We save the file and use them whenever we want in our programs. Based on the type and the uses of the code, modules are stored in packages.

Packages and libraries are more exchangeable words. A package can have sub-packages in it. In a package, there will be a __init__. py file defines it as a package, and the interpreter recognizes it as a package.

Like the generic term, a library is the collection of books and resources; in Python, a library is the collection of already made codes, documentation, classes, values, etc. The Python standard library contains the syntax and semantics of the tokens we use in Python, like if-else, loops, etc. In-built modules, that contain the basic functionality of Python are stored in the Python standard library. Python libraries are generally written in the C programming language.


Related Topics

Python PyMOTW

The cmd module comprises one class of the general public, Cmd, meant for command processors such interactive shells and other command interpreters as a foundation class. It utilises readline as...

3 minutes read.

Python if statement

Python if statement Decision making is an essential feature of any programming languages. Condition checking is the strength of decision making. Python provides many decision-making statements, such as: If statementIf-else statementelif statement if statement The if statement is...

2 minutes read.

Decision Tree Classification in Python

In this article, we will learn the implementation of the decision tree in Sklearn, which is nothing but the Scikit Learn library of python. First, we should learn what classification...

12 minutes read.

Python vs Java

There are a lot of programming languages out there, and every day, a new programming language is developing in some parts of the world. Each programming language is a mixture...

5 minutes read.

How to Plot Graphs Using Python?

In this article, we are going to learn about how to plot different types of graphs using Python. We are going to use different approaches for every type of graph....

3 minutes read.

Python MySQL Update Operation

Python MySQL Update Operation: In this part of tutorial, we will learn that how can we update a table present in SQL database through our Python program. As like SQL,...

4 minutes read.

Write Dictionary to CSV in Python

Python is an Object-Oriented high-level language. Python has an English-like syntax, which is very easy to read and write codes. Python is an interpreted language which means that it uses...

4 minutes read.

Python Queue

Python Queue There are various day to day activities where we find ourselves engaged with queues. Whether it is waiting in toll tax lane or standing on the billing counter for...

7 minutes read.

Artificial intelligence mini projects ideas in python

Artificial intelligence "The human race started from the invention of the wheel", and today we are about to advance to the Industrial level 4.0, where machines can work, talk, think and...

6 minutes read.

Augmented reality in python

In this article, we shall learn about augmented reality in python. Augmented reality is a technology that captures the world around you and adds virtual content or objects on top of...

3 minutes read.

Create First GUI Application using Tkinter in Python

GUI: A graphical interface (GUI) is a user interface that lets users interact with electronic devices like computers and smartphones by using menus, icons, and other visual cues (graphics). In contrast...

6 minutes read.

Sklearn in Python

Scikit-learn or sklearn is a machine learning library used in Python that provides many unsupervised and supervised learning tools and algorithms. David Cournapeau first created it as a 2007 Google...

7 minutes read.

Python Read Excel file

Python Read Excel file Excel is the spreadsheet application for Window, which is developed by Microsoft. The Excel stores data in the tabular form. It provides easy access to analyze and maintain the...

3 minutes read.

Find Median of List in Python

The median is an enlightening measurement that is utilized as a proportion of the focal inclination of a circulation. It is equivalent to the centre worth of the conveyance. There...

3 minutes read.

Python Banner

Python: Python is an interactive and more accessible language than any other programming language. The python programming language uses a variety of libraries to perform the operations in a faster way....

3 minutes read.

Find whether the given stringnumber is palindrome or not

Problem statement Sam is found of playing with strings. One day he thought of finding whether a string is a palindrome or not. He wanted to develop a computer process to...

2 minutes read.

Anytree Python

Python's anytree module is frequently used within data science-related software. Anytree has a Tolerant License, a Construct File that is public, no errors, no risks, and excellent support. One may...

3 minutes read.

Convert Float to Int in Python using Pandas

Introduction To play with huge amounts of data, in python we require a tool. The tool which is available in Python is pandas. A panda is an open-source library. It is...

4 minutes read.

Python SciPy Library

Introduction SciPy, a logical library for Python is an open-source, BSD-authorized library for arithmetic, science, and design. The SciPy library relies upon NumPy, which gives advantageous and quick N-dimensional exhibit control....

6 minutes read.

Python - Binomial Distribution

Introduction Definition of the Binomial Distribution The method of counting how many instances of a specific event there have been is called the binomial distribution. It will outline the possible outcomes or...

4 minutes read.