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:
commands: decorator to automatically build an argparse.ArgumentParser by decorating functions you want to expose as script subcommands
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file Pyng-1.0.14.tar.gz
.
File metadata
- Download URL: Pyng-1.0.14.tar.gz
- Upload date:
- Size: 80.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.18.3 setuptools/36.2.7 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/2.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 471ec10b56198bb15dca8e992f1626481d3c20d0ae016f73dde27f6562d9838b |
|
MD5 | 60712fb73474810763ae96cd080afd3b |
|
BLAKE2b-256 | ae9c7f8a0f6c52144c3b40aa624a39fb8d332a7357f9d276e61e480a073557e7 |