×

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

Find Words in String Python

Python : Python programming language is considered a general purpose; it is a high-level programming language that is not much difficult but easier to learn. Python programming language is rich in...

5 minutes read.

Python String count() method

Python String count() method The string.count() method returns the number of times a specified value appears in the string. Syntax string.count(sub[, start[, end]]) Parameter sub: This parameter represents a substring to be searched. start: This parameter...

1 minute read.

Python String isspace() method

Python String isspace() method The string.isspace() method returns a Boolean value true if there are only whitespace characters in the given string. This function is used to check if the given...

2 minutes read.

How to check version of Python

How to check version of python The versions of Python come with different kinds of features and functionalities. It is not a herculean task to keep track of the updates these...

3 minutes read.

How to comment out a block of code in Python

When you are writing code in Python, you may want to document it. You need to mention why a piece of code functions, for instance. Mathematics, algorithms, and intricate business...

4 minutes read.

Global variables in python

In Python, considering the scope, variables are categorized into global and local variables. In this article, we will discuss these two types along with examples. Any variable holds a value in...

4 minutes read.

Standard GUI Unit Converter 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...

12 minutes read.

Python Errors and exceptions

Exceptions and errors are the obstacles a programmer constantly faces while writing a program. Firstly, we need to understand what are errors and exceptions and the difference between these two...

6 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.

os.rename() method in Python

In Python, the os module provides the capacity to interact with the operating system. The operating system comes under the Python module. In this module, Python provides a specific feature...

3 minutes read.

Python Set isdisjoint() method

Python Set isdisjoint() method The set.isdisjoint() method in Python returns a boolean value True if two sets are disjoint sets ( i.e. none of the elements are present in both sets), otherwise it returns...

1 minute read.

Copying a file from one folder to Another with Python

In this article, we shall discuss copying a file from one folder to another using python functions. A file is a collection of data or information stored on a computer....

3 minutes read.

Composition in Python

Composition in Python Composition is one of the important concepts of Object-oriented programming (OOPs). Composition basically enables us for creating complex types objects by combining other types of objects in the...

6 minutes read.

any() Keyword in python

“any” keyword in python This page contains all the information about any () Keyword in python, how it is used with lists, tuples, dictionaries, sets, and what its function is? Python...

3 minutes read.

Read Text files in Python

In Python, there are many ways to read text files. Before going into the detailed structure of reading a text file, let us understand how reading text files takes place...

4 minutes read.

Sentiment Analysis using NLTK

Introduction Data is being produced at an astounding rate and volume in the field of the internet and other digital services nowadays. Researchers, engineers, and data analysts often work with tabular...

7 minutes read.

Periodogram in Python

Python:  Python programming language is one of the most used programming languages, as it is used widely in the field of software and data analysis, web development, etc. It is said...

3 minutes read.

Python Dictionary items() method

Python Dictionary items() method The dictionary.items() method in Python returns a view object that displays a list of dictionary's (key, value) tuple pairs. Syntax dictionary.items() Parameter NA Return This method returns a view object, displaying the list...

1 minute read.

wxPython Panel class

wxPython Panel class The Widgets which is shown in the frame of GUI window such as text box, buttons, static text etc. are put inside the panel class of the wxpython...

2 minutes read.

Python Printf Style Formating

String objects have one special implicit activity: the % administrator (modulo). This is otherwise called the string designing or interjection administrator. Given design % values (where configuration is a string),...

3 minutes read.