Python Built-in Modules: Exploring Integrated Functionalities

Discover the built-in modules in Python that extend the language's capabilities beyond its core features. These modules, written in C, provide system-specific functionalities for OS management, I/O operations, and more. Explore a list of key built-in modules and their uses.



Python - Built-in Modules

The Python interactive shell includes a number of built-in modules that provide additional functionalities beyond the basic Python language features.

These modules are written in C and integrated with Python, offering system-specific functionalities like OS management, IO operations, and more. Here's a list of some built-in modules:


IPython             _weakrefset         heapq               secrets
__future__          _winapi             hmac                select
_abc                abc                 html                selectors
_ast                aifc                http                setuptools
_asyncio            antigravity         idlelib             shelve
_bisect             argparse            imaplib             shlex
_blake2             array               imghdr              shutil
_bootlocale         ast                 imp                 signal
_bz2                asynchat            importlib           simplegeneric
_codecs             asyncio             ind                 site
_codecs_cn          asyncore            inspect             six
_codecs_hk          atexit              io                  smtpd
_codecs_iso2022     audioop             ipaddress           smtplib
_codecs_jp          autoreload          ipython_genutils    sndhdr
_codecs_kr          backcall            itertools           socket
_codecs_tw          base64              jedi                socketserver
_collections        bdb                 json                sqlite3
_collections_abc    binascii            keyword             sre_compile
_compat_pickle      binhex              lib2to3             sre_constants
_compression        bisect              linecache           sre_parse
_contextvars        builtins            locale              ssl
_csv                bz2                 logging             stat
_ctypes             cProfile            lzma                statistics
_ctypes_test        calendar            macpath             storemagic
_datetime           cgi                 mailbox             string
_decimal            cgitb               mailcap             stringprep
_distutils_findvs   chunk               marshal             struct
_dummy_thread       cmath               math                subprocess
_elementtree        cmd                 mimetypes           sunau
_functools          code                mmap                symbol
_hashlib            codecs              modulefinder        sympyprinting
_heapq              codeop              msilib              symtable
_imp                collections         msvcrt              sys
_io                 colorama            multiprocessing     sysconfig
_json               colorsys            netrc               tabnanny
_locale             compileall          nntplib             tarfile
_lsprof             concurrent          nt                  telnetlib
_lzma               configparser        ntpath              tempfile
_markupbase         contextlib          nturl2path          test
_md5                contextvars         numbers             tests
_msi                copy                opcode              textwrap
_multibytecodec     copyreg             operator            this
_multiprocessing    crypt               optparse            threading
_opcode             csv                 os                  time
_operator           ctypes              parser              timeit
_osx_support        curses              parso               tkinter
_overlapped         cythonmagic         pathlib             token
_pickle             dataclasses         pdb                 tokenize
_py_abc             datetime            pickle              trace
_pydecimal          dbm                 pickleshare         traceback
_pyio               decimal             pickletools         tracemalloc
_queue              decorator           pip                 traitlets
_random             difflib             pipes               tty
_sha1               dis                 pkg_resources       turtle
_sha256             distutils           pkgutil             turtledemo
_sha3               doctest             platform            types
_sha512             dummy_threading     plistlib            typing
_signal             easy_install        poplib              unicodedata
_sitebuiltins       email               posixpath           unittest
_socket             encodings           pprint              urllib
_sqlite3            ensurepip           profile             uu
_sre                enum                prompt_toolkit      uuid
_ssl                errno               pstats              venv
_stat               faulthandler        pty                 warnings
_string             filecmp             py_compile          wave
_strptime           fileinput           pyclbr              wcwidth
_struct             fnmatch             pydoc               weakref
_symtable           formatter           pydoc_data          webbrowser
_testbuffer         fractions           pyexpat             winreg
_testcapi           ftplib              pygments            winsound
_testconsole        functools           queue               wsgiref
_testimportmultiple gc                  quopri              xdrlib
_testmultiphase     genericpath         random              xml
_thread             getopt              re                  xmlrpc
_threading_local    getpass             reprlib             xxsubtype
_tkinter            gettext             rlcompleter         zipapp
_tracemalloc        glob                rmagic              zipfile
_warnings           gzip                runpy               zipimport
_weakref            hashlib             sched               zlib  

For a complete list of available modules in your Python environment, use the following command in the Python console:


help('modules')
  

These built-in modules are part of the standard library and provide extensive utilities for various programming tasks.

Name Brief Description
os This module provides a unified interface to a number of operating system functions.
string This module contains a number of functions for string processing.
re This module provides a set of powerful regular expression facilities. Regular expression (RegEx) allows powerful string search and matching for a pattern in a string.
math This module implements a number of mathematical operations for floating point numbers. These functions are generally thin wrappers around the platform C library functions.
cmath This module contains a number of mathematical operations for complex numbers.
datetime This module provides functions to deal with dates and the time within a day. It wraps the C runtime library.
gc This module provides an interface to the built-in garbage collector.
asyncio This module defines functionality required for asynchronous processing.
Collections This module provides advanced Container datatypes.
Functools This module has Higher-order functions and operations on callable objects. Useful in functional programming.
operator Functions corresponding to the standard operators.
pickle Convert Python objects to streams of bytes and back.
socket Low-level networking interface.
sqlite3 A DB-API 2.0 implementation using SQLite 3.x.
statistics Mathematical statistics functions.
typing Support for type hints.
venv Creation of virtual environments.
json Encode and decode the JSON format.
wsgiref WSGI Utilities and Reference Implementation.
unittest Unit testing framework for Python.
random Generate pseudo-random numbers.

These built-in modules offer a wide range of functionalities from basic string operations and regular expressions to advanced mathematical computations, database interactions, and asynchronous programming support.