Python How To: List of standard modules included with Python

Python Programming

Here’s a list of the standard Python modules that are included with Python:

  • abc: Abstract Base Classes
  • argparse: Command-line Argument Parsing
  • array: Efficient arrays of numeric values
  • asyncio: Asynchronous I/O, event loop, coroutines and tasks
  • atexit: Exit handlers
  • base64: Base16, Base32, Base64, Base85 Data Encodings
  • bisect: Array bisection algorithm
  • builtins: Built-in objects
  • cProfile: Deterministic profiling of Python programs
  • calendar: General calendar-related functions
  • cgi: Common Gateway Interface support
  • cgitb: Traceback manager for CGI scripts
  • chunk: Tools for iterating over iterables by chunk
  • cmath: Mathematical functions for complex numbers
  • cmd: Support for line-oriented command interpreters
  • codecs: Codec registry and base classes
  • codeop: Compile (possibly incomplete) Python code
  • collections: Container datatypes
  • colorsys: Conversions between color systems
  • compileall: Byte-compile Python source files
  • concurrent: Executors for concurrent.futures
  • configparser: Configuration file parser
  • contextlib: Utilities for with-statement contexts
  • contextvars: Context Variables
  • copy: Shallow and deep copy operations
  • copyreg: Register pickle support functions
  • crypt: Functionality for one-way hashing of data
  • csv: CSV File Reading and Writing
  • ctypes: A foreign function library for Python
  • dataclasses: Data Classes
  • datetime: Basic date and time types
  • decimal: Decimal fixed point and floating point arithmetic
  • difflib: Helpers for computing deltas
  • dis: Disassembler for Python bytecode
  • distutils: Building and installing Python modules
  • doctest: Test interactive Python examples
  • email: Package supporting the parsing, manipulation, and generating of email messages
  • encodings: Encoding and decoding of strings
  • enum: Support for enumerations
  • errno: Standard errno system symbols
  • faulthandler: Dump the Python traceback
  • fcntl: The fcntl and ioctl system calls
  • filecmp: File and Directory Comparisons
  • fileinput: Iterate over lines from multiple input streams
  • fnmatch: Unix-style filename pattern matching
  • formatter: Generic output formatting
  • fractions: Rational Numbers
  • ftplib: FTP protocol client
  • functools: Higher-order functions and operations on callable objects
  • gc: Garbage Collector interface
  • getopt: C-style parser for command line options
  • getpass: Portable password input
  • gettext: Multilingual internationalization services
  • glob: Unix style pathname pattern expansion
  • grp: Group Database (getgrnam() and friends)
  • gzip: Support for gzip files
  • hashlib: Secure hashes and message digests
  • heapq: Heap queue algorithm
  • hmac: Keyed-Hashing for Message Authentication
  • html: HyperText Markup Language support
  • http: HTTP protocol client and server
  • imaplib: IMAP4 protocol client
  • imghdr: Determine the type of an image file
  • imp: Deprecated, Importing modules
  • importlib: A powerful and flexible importer mechanism
  • inspect: Inspect live objects
  • io: Core tools for working with streams
  • ipaddress: IPv4/IPv6 manipulation library
  • itertools: Functions creating iterators for efficient looping
  • json: JSON encoder and decoder
  • keyword: Testing for Python keywords
  • lib2to3: Automated Python 2 to 3 code translation
  • linecache: Random access to text lines
  • locale: Internationalization services
  • logging: Flexible event logging system for applications
  • lzma: Compression using the LZMA algorithm
  • mailbox: Manipulate mailboxes in various formats
  • mailcap: Mailcap file handling
  • marshal: Internal Python object serialization
  • math: Mathematical functions (sin() etc.)
  • mimetypes: Map filenames to MIME types
  • mmap: Memory-mapped file support
  • modulefinder: Find modules used by a script
  • multiprocessing: Process-based parallelism
  • netrc: Read netrc files
  • nntplib: NNTP protocol client
  • numbers: Numeric abstract base classes
  • opcode: Operations codes used by the Python interpreter
  • optparse: Deprecated since version 3.2: Use argparse instead
  • os: Miscellaneous operating system interfaces
  • ossaudiodev: Access to OSS-compatible audio devices
  • parser: Access parse trees for Python source code
  • pathlib: Object-oriented filesystem paths
  • pdb: The Python Debugger
  • pickle: Python object serialization
  • pickletools: Tools for working with Python pickles
  • pipes: Interface to shell pipelines
  • pkgutil: Package extension utility
  • platform: Platform identification
  • plistlib: Generate and parse Mac OS X .plist files
  • poplib: POP3 protocol client
  • pprint: Data pretty printer
  • profile: Deterministic profiling of Python programs
  • pstats: Statistics object for use with the profiler
  • pty: Pseudo-Terminal Handling for Linux
  • pwd: Password database (getpwnam() and friends)
  • py_compile: Compile Python source files to bytecode
  • queue: A synchronized queue class
  • quopri: Encode and decode MIME quoted-printable data
  • random: Generate pseudo-random numbers
  • re: Regular expression operations
  • readline: GNU readline support
  • reprlib: Alternate repr() implementation
  • resource: Resource usage information
  • rlcompleter: Completion function for GNU readline
  • runpy: Locating and running Python modules
  • sched: Event scheduler
  • secrets: Generate secure random numbers for managing secrets
  • select: Waiting for I/O completion
  • shelve: Python object persistence
  • shlex: Simple lexical analysis
  • shutil: High-level file operations
  • signal: Set handlers for asynchronous events
  • site: Site-specific configuration hook
  • smtpd: SMTP server classes
  • smtplib: SMTP protocol client
  • sndhdr: Determine type of sound file
  • socket: Low-level networking interface
  • socketserver: A framework for network servers
  • sqlite3: DB-API 2.0 interface for SQLite databases
  • ssl: TLS/SSL wrapper for socket objects
  • stat: Interpreting stat() results
  • statistics: Mathematical statistics functions
  • string: Common string operations
  • stringprep: Internet string preparation
  • struct: Interpret bytes as packed binary data
  • subprocess: Subprocess management
  • sunau: Read and write Sun AU files
  • symbol: Constants used with Python parse trees
  • symtable: Access to the symbol tables used by the Python compiler
  • sys: System-specific parameters and functions
  • sysconfig: Access Python’s configuration information
  • tabnanny: Indentation validator
  • tarfile: Read and write tar archive files
  • telnetlib: Telnet client
  • tempfile: Generate temporary files and directories
  • termios: POSIX terminal control
  • test: Support for unit testing
  • textwrap: Text wrapping and filling
  • this: Prints the Zen of Python
  • threading: Thread-based parallelism
  • time: Time access and conversions
  • timeit: Measure execution time of small code snippets
  • tkinter: Python interface to Tcl/Tk
  • token: Constants representing terminal nodes of Python parse trees
  • tokenize: Tokenize Python source code
  • trace: Trace or track Python statement execution
  • traceback: Print or retrieve a stack traceback
  • tracemalloc: Debug tools for tracking memory allocations
  • tty: Terminal control functions
  • turtle: Turtle graphics
  • turtledemo: Demonstration suite for the turtle graphics module
  • types: Dynamic type creation and names for built-in types
  • typing: Support for type hints
  • unicodedata: Unicode Database
  • unittest: Unit testing framework
  • urllib: URL handling modules
  • uu: UUencode and UUdecode files
  • uuid: UUID objects according to RFC 4122
  • venv: Creation of virtual environments
  • warnings: Warning control
  • wave: Read and write WAV files
  • weakref: Weak references
  • webbrowser: Convenient Web-browser controller
  • wsgiref: WSGI Utilities and Reference Implementation
  • xdrlib: Encode and decode XDR data
  • xml: Package containing XML processing modules
  • xmlrpc: XML-RPC server and client modules
  • zipapp: Manage executable Python zip archives
  • zipfile: Work with ZIP archives
  • zipimport: Import modules from ZIP archives.
  • zlib: Compression and decompression using the zlib library.

It’s worth noting that not all of these modules are available on all platforms, and some of them may have platform-specific behaviors. Additionally, Python has an extensive library of third-party modules available for download, which can greatly expand its capabilities.

Please follow and like us:

Sign up for my newsletter to receive updates on the best deals, free games and my latest Live Streams.

We don’t spam!

Leave a reply