Package: plib3.stdlib
The PLIB3.STDLIB package contains a number of useful packages
and modules that extend the Python 3 standard library. The
latest official release is available on PyPI athttps://pypi.org/project/plib3.stdlib/and the latest source code is available on Gitlab athttps://gitlab.com/pdonis/plib3-stdlib.PLIB3.STDLIB is built using thebuildPEP 517 build tool
with thesetuputils_buildbackend, which uses thesetuputilshelper module to build the setup.cfg file that
is included with the distribution. This module and build backend
are available athttps://gitlab.com/pdonis/setuputils3.The PLIB3.STDLIB Packages and ModulesThe following modules or sub-packages are available in theplib.stdlibnamespace:Thebuiltinsmodule contains some funtions that should be
Python builtins, but aren’t. :) Importing the module adds those
functions to the built-in namespace; this is mostly useful for
interactive shells. The functions can also be imported directly
fromplib.stdlib.builtins, to make it easier to understand
where the functions are coming from in module code.Theclasstoolsmodule provides some utilities for working
with classes and class attributes.Thecmdlinemodule provides utilities useful for command
line programs and interactive shells.Thecollsub-package provides various collection classes,
including abstract collections built on thecollectionsABCs from the standard library.Thecopytoolsmodule provides functions to copy function
and code objects, whichcopy.copyin the Python standard
library just returns unchanged. This allows copies of such
objects to be made with selected attributes changed.Thecsvtoolsmodule provides useful functions for working
with CSV files.Thedecotoolsmodule provides functions and factories for
working with decorators.Theexamplesmodule contains entry point functions for the
example programs shipped withplib3.stdlib.Thefdtoolsmodule provides utilities for working with file
descriptors.Theimpmodule provides theimport_from_modulefunction,
which should be in the standard libraryimportlibmodule
but isn’t. :)Theinisub-package implements an abstract ‘INI file’ API that
usesConfigParseron POSIX systems, and the Windows registry
on Windows systems. This API allows the configuration file
structure to be declared using Python lists and dicts.Theitersmodule provides various functions dealing with
or returning iterables.Thejsontoolsmodule provides convenience functions for
loading and saving JSON files, and for “extended” JSON that
allows “literal” Python types like tuples that standard JSON
does not support.Thelocalizemodule provides useful functions for getting
locale-specific information.Themailmodule provides a useful shortcut function for
sending email from programs.Themathlibmodule provides some additional math functions
to supplement those in the standard library.Thenetsub-package provides simple network socket client
and transport objects, and utilities for getting information
about networks.Theoptionsmodule provides an easier-to-use overlay for
theargparsemodule which allows you to express your option
configuration in the form of Python lists, tuples, and dicts.Theostoolsmodule provides utilities for working with the
operating system.Thepostinstallmodule provides utilities to obtain information
about the installation of a project and to run scripts from the
shared data directory tree installed for the project, such as
example programs.Theprocmodule provides two shortcut functions for getting
the output of a subprocess.Thesigsmodule provides a context manager for installing
signal handlers.Thestringsmodule provides functions and constants for
working with strings.Thesystoolsmodule provides a context manager for temporarily
changingsys.path.Thetimermodule provides functions for timing code, with
an alternate API to the standard library’stimeitmodule
that is easier to use when timing functions that you already
have as objects, instead of source code strings.Thetztoolsmodule provides some usefultzinfosubclasses
based on those in the Python docs for thedatetimemodule,
and a function to return the local system timezone name.Theutilsub-package provides theModuleProxyclass, which
is used by a number of PLIB3 sub-packages. See the docstrings
for the class and the sub-packages using it for more information.InstallationThe simplest way to install PLIB3.STDLIB is by usingpip:$ python3 -m pip install plib3.stdlibThis will download the latest release from PyPI and install it
on your system. If you already have a downloaded source tarball or
wheel, you can havepipinstall it directly by giving its
filename in place of “plib3.stdlib” in the above command line.Example ProgramsPLIB3.STDLIB comes with example programs that illustrate key features
of some sub-packages. After installation, these can be found in the$PREFIX/share/plib3.stdlib/examplesdirectory. If you have a
POSIX system (Linux or Mac OSX), script wrappers to run these
programs will be installed into the$PREFIX/bindirectory.The Zen of PLIB3There is no single unifying purpose or theme to PLIB3, but
like Python itself, it does have a ‘Zen’ of sorts:Express everything possible in terms of built-in Python
data structures.Once you’ve expressed it that way, what the code is
going to do with it should be obvious.Avoid boilerplate code,andboilerplate data. Every
piece of data your program needs should have one and
only one source.Copyright and LicensePLIB3.STDLIB is Copyright (C) 2008-2022 by Peter A. Donis.This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (See the LICENSE.txt file for a
copy of version 2 of the License.)This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.