Skip to main content

Yet another collection of Python utility functions

Project description

Pyng is a collection of Python utility functions I’ve written over the years, and that I keep wishing were available everywhere. Sadly, in many cases I’ve simply pasted copies of individual functions as needed. But no more!

It’s organized as follows:

  • dicts: dict subsets, dict searching
  • exc: manipulate exceptions, e.g. reraise, retry
  • genio: generator-based file I/O, loosely related to Java file streams
  • graph: filter DAG represented as dict of (key, otherkeys)
  • iters: generic iterator functionality, akin to itertools
  • out: construct a file-like output object to wrap a specified sink function, with buffer_lines as a useful example and syslogger as a practical use case
  • relwalk: os.walk() filtered to produce pathnames relative to the starting directory
  • replacefile: filter a text file in-place
  • timing: time-related utilities, e.g. duration() to produce a human-friendly description of a specified interval and ProgressTimer to abstract ETA computations
  • tk: Tkinter utilities, e.g. prompt for a single password or construct a prompt dialog from (description, type) tuples
  • toposort: topological sort of DAG represented as dict of (key, otherkeys)

In addition…

  • ProgressBar provides experimental progress-bar support for a long- running console script, from self-overwriting console messages through wxPython, zenity, Tkinter. This is very much a work in progress, though functional subsets have been successfully used.

Please see the individual docstrings for more information.

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
Pyng-0.6.3.tar.gz (49.7 kB) Copy SHA256 hash SHA256 Source None Nov 22, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page