Skip to main content

Useful packages and modules to extend the Python 3 standard library.

Project description

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 at https://pypi.org/project/plib3.stdlib/ and the latest source code is available on Gitlab at https://gitlab.com/pdonis/plib3-stdlib.

PLIB3.STDLIB is built using the build PEP 517 build tool with the setuptools:build_meta backend. It uses the setuputils helper module to build the setup.cfg file that is included with the distribution. This module is available at https://gitlab.com/pdonis/setuputils3.

The PLIB3.STDLIB Packages and Modules

The following modules or sub-packages are available in the plib.stdlib namespace:

  • The builtins module 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 from plib.stdlib.builtins, to make it easier to understand where the functions are coming from in module code.

  • The classtools module provides some utilities for working with classes and class attributes.

  • The cmdline module provides utilities useful for command line programs and interactive shells.

  • The coll sub-package provides various collection classes, including abstract collections built on the collections ABCs from the standard library.

  • The copytools module provides functions to copy function and code objects, which copy.copy in the Python standard library just returns unchanged. This allows copies of such objects to be made with selected attributes changed.

  • The csvtools module provides useful functions for working with CSV files.

  • The decotools module provides functions and factories for working with decorators.

  • The fdtools module provides utilities for working with file descriptors.

  • The imp module provides the import_from_module function, which should be in the standard library importlib module but isn’t. :)

  • The ini sub-package implements an abstract ‘INI file’ API that uses ConfigParser on POSIX systems, and the Windows registry on Windows systems. This API allows the configuration file structure to be declared using Python lists and dicts.

  • The iters module provides various functions dealing with or returning iterables.

  • The jsontools module 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.

  • The localize module provides useful functions for getting locale-specific information.

  • The mail module provides a useful shortcut function for sending email from programs.

  • The mathlib module provides some additional math functions to supplement those in the standard library.

  • The net sub-package provides simple network socket client and transport objects, and utilities for getting information about networks.

  • The options module provides an easier-to-use overlay for the argparse module which allows you to express your option configuration in the form of Python lists, tuples, and dicts.

  • The ostools module provides utilities for working with the operating system.

  • The postinstall module 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.

  • The proc module provides two shortcut functions for getting the output of a subprocess.

  • The sigs module provides a context manager for installing signal handlers.

  • The strings module provides functions and constants for working with strings.

  • The systools module provides a context manager for temporarily changing sys.path.

  • The timer module provides functions for timing code, with an alternate API to the standard library’s timeit module that is easier to use when timing functions that you already have as objects, instead of source code strings.

  • The tztools module provides some useful tzinfo subclasses based on those in the Python docs for the datetime module, and a function to return the local system timezone name.

  • The util sub-package provides the ModuleProxy class, 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.

Installation

The simplest way to install PLIB3.STDLIB is by using pip:

$ python3 -m pip install plib3.stdlib

This 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 have pip install it directly by giving its filename in place of “plib3.stdlib” in the above command line.

Example Programs

PLIB3.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/examples directory. If you have a POSIX system (Linux or Mac OSX), script wrappers to run these programs will be installed into the $PREFIX/bin directory.

The Zen of PLIB3

There 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, and boilerplate data. Every piece of data your program needs should have one and only one source.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plib3.stdlib-2.1.tar.gz (130.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plib3.stdlib-2.1-py3-none-any.whl (145.9 kB view details)

Uploaded Python 3

File details

Details for the file plib3.stdlib-2.1.tar.gz.

File metadata

  • Download URL: plib3.stdlib-2.1.tar.gz
  • Upload date:
  • Size: 130.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.9

File hashes

Hashes for plib3.stdlib-2.1.tar.gz
Algorithm Hash digest
SHA256 46997fee887dce40626dfa0914b7bb21bb9ac85be6261a030d58e1ff22bd7bc3
MD5 f15097182be5f0099c06f4a1608b4b3d
BLAKE2b-256 38021451b6773bd6121be909bd5a96cd920fe45a84a5f17010b35d9220e51b8a

See more details on using hashes here.

File details

Details for the file plib3.stdlib-2.1-py3-none-any.whl.

File metadata

  • Download URL: plib3.stdlib-2.1-py3-none-any.whl
  • Upload date:
  • Size: 145.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.9

File hashes

Hashes for plib3.stdlib-2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d31f8f0dead071a14e280283a78697bd09fe86f950a257810ea057c4cdfe1cec
MD5 cc5d7b4688f2f0f09c691531f815e1cd
BLAKE2b-256 26ab394e0ce3a5432d24ff2f1481ae1243ec60fe481e7686917cc5e1890adff3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page