Skip to main content

Nifty tools and containers

Project description


Specialized containers as alternatives to Python’s built-in types and to those defined in the collections standard module.

  • defaultnamedtuple factory function for namedtuples with default arguments
  • forwardingdict defaultdict subclass that passes missing key to factory


Higher order functions like those found in languages like Haskell.

  • compose compose a list of functions
  • flip create a function with reversed arguments of another function
  • foldl left-associative reduce
  • foldr right-associatve reduce


Utilities for manipulating text.

  • color add ansi colors and styles to strings


Utility functions for manipulating containers. Thanks Jack Fischer, for the idea for rmap.

  • subdict extract a subset of a dictionary
  • match compare multiple objects based on a list of shared attributes
  • rmap recursively map a function onto items of nested containers
  • head get the first element of a sequence
  • tail get all but the first element of a sequence
  • last get the last element of a sequence
  • init get all but the last element of a sequence

Project details

Download files

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

Files for skrt, version
Filename, size File type Python version Upload date Hashes
Filename, size skrt- (5.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page