Python Standard Libraries

OPP873- “Python Standard Libraries”

NOTE :- All the standard Libraries information can be found in official link  ans also found here . Listing below are some of the important modules and other modules like re are covered in our tutorial

OPP874-“Built-in functions”

Please click here for complete information with examples on built-in functions

OPP875-“Some important Built-in Functions”

Some important built-in which might be asked in interviews are (all are important but some usually might be asked in interviews)

callable() , chr(), compile() , dict()dir()enumerate(), eval(),exec()filter()format(),globals()id()input(),isinstance()iter()memoryview()range(), repr(),set()str()type(),zip()

 OPP876-“ Built in Constants”

Please click here for complete information with examples on built-in constants

OPP877-“Built in types”

 Built in types refers to numerics, sequences, mappings, files, classes, instances and exceptions. Everything is mentioned in our tutorial also please click the below link for complete information with examples on built-in types

Please click here and also here for complete information with examples on built-in types

OPP878-“String Services”

The string module contains a number of useful constants and classes, as well as some deprecated legacy functions that are also available as methods on strings

Please click here for complete information on string or please check our tutorial

OPP878-“Struct

This can be used in handling binary data stored in files or from network connections, among other sources. Interept string as packed binary data

Please click here for complete information on struct

 OPP879-“ Difflib “

This module provides classes and functions for comparing sequences. It can be used for example, for comparing files, and can produce difference information in various formats, including HTML and context and unified diffs.

Please click here for complete information on difflib

OPP880-“StringIO”

 This module implements a file-like class, StringIO, that reads and writes a string buffer (also known as memory files).

Please click here for complete information on StringIO

OPP881-“textwrap”

It acts as text wrapping and filling

Please click here for complete information on textwrap

OPP882-“Codecs “

This module defines base classes for standard Python codecs (encoders and decoders) and provides access to the internal Python codec registry which manages the codec and error handling lookup process

Please click here for complete information on codecs

OPP883-“Unicodedata “

This module provides access to the Unicode Character Database which defines character properties for all Unicode characters.

Please click here for complete information on unicodedata

OPP884-“stringprep”

The module stringprep only exposes the tables from RFC 3454.

Please click here for complete information on stringprep

OPP885-“DateTime “

The datetime module supplies classes for manipulating dates and times in both simple and complex ways.

Please click here for complete information on datetime

OPP886-“Calendar”

This module allows you to output calendars like the Unix cal program, and provides additional useful functions related to the calendar.

Please click here for complete information on calender

OPP887-“Collections “

This module implements specialized container datatypes providing alternatives to Python’s general purpose built-in containers, dictlistset, and tuple.

Please click here for complete information on collections

OPP888-“Heapq “

This module provides an implementation of the heap queue algorithm

Please click here for complete information on Heapq

OPP889-“bisect”

This module provides support for maintaining a list in sorted order without having to sort the list after each insertion

Please click here for complete information on bisect

OPP890-“Sched”

The sched module defines a class which implements a general purpose event scheduler:

Please click here for complete information on sched

OPP891-“ Queue”

The Queue module implements multi-producer, multi-consumer queues. It is especially useful in threaded programming when information must be exchanged safely between multiple threads.

Please click here for complete information on Queue

OPP892-“weakref”

The weakref module allows the Python programmer to create weak references to objects.

A weak reference to an object is not enough to keep the object alive: when the only remaining references to a referent are weak references, garbage collection is free to destroy the referent and reuse its memory for something else. A primary use for weak references is to implement caches or mappings holding large objects, where it’s desired that a large object not be kept alive solely because it appears in a cache or mapping.

Please click here for complete information on weakref

OPP893-“Userdict, Userlist, Userstr”

These modules acts as a wrapper around dictionary objects, lists and strings

Please click here for complete information on “Userdict, Userlist, Userstr”

OPP894-“pprint “

The pprint module provides a capability to “pretty-print” arbitrary Python data structures in a form which can be used as input to the interpreter.

Please click here for complete information on “pprint”

OPP895-“Math”

This module is always available. It provides access to the mathematical functions defined by the C standard.

Please click here for complete information on “math”

OPP896-“Decimal”

The decimal module provides support for decimal floating point arithmetic. It offers several advantages over the float datatype:

Please click here for complete information on “decimal”

OPP897-“Fractions”

The fractions module provides support for rational number arithmetic.

Please click here for complete information on “fractions”

OPP898-“Random”

This module implements pseudo-random number generators for various distributions.

Please click here for complete information on “random”

OPP899-“Functools”

The functools module is for higher-order functions: functions that act on or return other functions.

Please click here for complete information on “functools”

OPP900-“Operator”

The operator module exports a set of efficient functions corresponding to the intrinsic operators of Python. For example, operator.add(x, y) is equivalent to the expression x+y.

Please click here for complete information on “operators”

OPP901-“File and Directory Access”

The modules described in this chapter deal with disk files and directories. For example, there are modules for reading the properties of files, manipulating paths in a portable way, and creating temporary files.

Please click here for complete information on “file & directory access”

OPP902-“os.path”

This module implements some useful functions on pathnames.

Please click here for complete information on “os.path”

OPP903-“fileinput”

This module implements a helper class and functions to quickly write a loop over standard input or a list of files.

Please click here for complete information on “fileinput”

OPP904-“Stat”

The stat module defines constants and functions for interpreting the results of os.stat()os.fstat() and os.lstat() (if they exist).

Please click here for complete information on “stat”

OPP905-“filecmp”

The filecmp module defines functions to compare files and directories, with various optional time/correctness trade-offs

Please click here for complete information on “filecmp”

OPP906-“tempfile”

This module generates temporary files and directories. It works on all supported platforms.

Please click here for complete information on “tempfile”

OPP907-“glob”

The glob module finds all the pathnames matching a specified pattern according to the rules used by the Unix shell,

Please click here for complete information on “glob”

OPP908-“linecache”

The linecache module allows one to get any line from any file, while attempting to optimize internally, using a cache, the common case where many lines are read from a single file.

Please click here for complete information on “linecache”

OPP909-“shutil”

The shutil module offers a number of high-level operations on files and collections of files. In particular, functions are provided which support file copying and removal.

Please click here for complete information on “shutil”

OPP910-“pickle”

The pickle module implements a fundamental, but powerful algorithm for serializing and de-serializing a Python object structure. “Pickling” is the process whereby a Python object hierarchy is converted into a byte stream, and “unpickling” is the inverse operation, whereby a byte stream is converted back into an object hierarchy. Pickling (and unpickling) is alternatively known as “serialization”, “marshalling,” [1] or “flattening”, however, to avoid confusion, the terms used here are “pickling” and “unpickling”.

Please click here for complete information on “pickle”

OPP911-“marshal”

This module contains functions that can read and write Python values in a binary format.

Please click here for complete information on “marshal”

OPP912-“Sqlite3”

SQLite is a C library that provides a lightweight disk-based database that doesn’t require a separate server process and allows accessing the database using a nonstandard variant of the SQL query language.

The sqlite3 module provides SQL interface

Please click here for complete information on “marshal”

OPP913-“zlib”

For applications that require data compression, the functions in this module allow compression and decompression, using the zlib library.

Please click here for complete information on “zlib”

 OPP914-“gzip”

This module provides a simple interface to compress and decompress files just like the GNU programs gzip and gunzip would.

Please click here for complete information on “gzip”

OPP915-“bz2”

This module provides a comprehensive interface for the bz2 compression library.

Please click here for complete information on “bz2”

OPP916-“zipfile”

The ZIP file format is a common archive and compression standard. This module provides tools to create, read, write, append, and list a ZIP file.

Please click here for complete information on “zip”

OPP917-“tarfile”

The tarfile module makes it possible to read and write tar archives, including those using gzip or bz2 compression.

Please click here for complete information on “tarfile”

OPP918-“OS”

This module provides a portable way of using operating system dependent functionality.

Please click here for complete information on “os”

OPP919-“IO”

T he io module provides the Python interfaces to stream handling.

Please click here for complete information on “io”

OPP920-“subprocess”

The subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes.

Please click here for complete information on “subprocess”

 OPP921-“Json”

json exposes an API familiar to users of the standard library marshal and pickle modules.

Please click here for complete information on “json”

OPP922-“gettext”

The gettext module provides internationalization (I18N) and localization (L10N) services for your Python modules and applications.

Please click here for complete information on “gettext”

OPP923-“locale”

The locale module opens access to the POSIX locale database and functionality.

Please click here for complete information on “locale”

OPP924-“tkinter”

The Tkinter module (“Tk interface”) is the standard Python interface to the Tk GUI toolkit. Both Tk and Tkinter are available on most Unix platforms, as well as on Windows systems.

Please click here for complete information on “tkinter”

OPP925-“pydoc”

The pydoc module automatically generates documentation from Python modules.

Please click here for complete information on “pydoc”

OPP926-“doctest”

The doctest module searches for pieces of text that look like interactive Python sessions, and then executes those sessions to verify that they work exactly as shown.

Please click here for complete information on “doctest”

OPP927-“unitest”

unittest supports test automation, sharing of setup and shutdown code for tests, aggregation of tests into collections, and independence of the tests from the reporting framework.

Please click here for complete information on “unitest”

OPP928-“2to3”

2to3 is a Python program that reads Python 2.x source code and applies a series of fixers to transform it into valid Python 3.x code.

Please click here for complete information on “2to3”

OPP929-“bdb”

The bdb module handles basic debugger functions, like setting breakpoints or managing execution via the debugger.

Please click here for complete information on “bdb”

OPP930-“Pdb”

The module pdb defines an interactive source code debugger for Python programs.

Please click here for complete information on “pdb”

OPP931-“sys”

This module provides access to some variables used or maintained by the interpreter and to functions that interact strongly with the interpreter.

Please click here for complete information on “sys”

OPP932-“__main__”

This module represents the (otherwise anonymous) scope in which the interpreter’s main program executes — commands read either from standard input, from a script file, or from an interactive prompt

Please click here for complete information on “__main__”

OPP935-“gc”

This module provides an interface to the optional garbage collector. It provides the ability to disable the collector, tune the collection frequency, and set debugging options. It also provides access to unreachable objects that the collector found but cannot free

Please click here for complete information on “gc”

OPP936-“runpy”

The runpy module is used to locate and run Python modules without importing them first. Its main use is to implement the -m command line switch that allows scripts to be located using the Python module namespace rather than the filesystem.

Please click here for complete information on “runpy”

OPP937-“syslog”

This module provides an interface to the Unix syslog library routines.

Please click here for complete information on “syslog”