Pithy is a collection of utility libraries for Python 3.


Keywords
ansi, apfs, buffer, chart, clone, console, crawl, csv, diff, format, graph, graphviz, html, iterable, json, lex, lexer, lexing, msgpack, parse, parser, parsing, scrape, sqlite, svg, syntax, test, testing, term, terminal, token, tokenization, tokenizer, types, typing, unicode, unit, utilities, xml, zst, zstandard
License
CC0-1.0
Install
pip install pithy==0.0.13

Documentation

Pithy

Pithy is a small library of Python 3.6 utilities. The various modules are mostly independent of each other.

The project is hosted at 'https://github.com/gwk/pithy'.

  • ansi Ansi console control strings for colors and other terminal IO.
  • buffer Buffer is an iterable class that lets you peek at and push back elements. Useful for parsing.
  • collection Collection utilities.
  • csv_utils CSV (comma-separated-value table files) utilities.
  • data Date and time utilities.
  • defaultlist DefaultList is a list subclass, analogous to defaultdict.
  • format Python format string parsing utilities.
  • fs File system utilities.
  • graph_utils Graph (as in network, not chart) utilities.
  • immutable Immutable object utilitise.
  • io IO utilites, including shorthand functions for printing to stdout and stderr.
  • iterable Iterable utilities.
  • json_utils JSON, JSONL (per-line JSON), and JSONS (concatenated/streamable JSON) utilities.
  • lex Easily create robust lexers from regular expressions.
  • meta Python metaprogramming tools (it's a slippery slope!).
  • path_encode Like urlencode, for creating sensible filesystem paths.
  • schema Compute the common structure for a collection of data examples.
  • sentinel Even sillier than NPM's left-pad.
  • sequence Sequence utilities.
  • string_utils String utilities.
  • tag_parse Simplistic parser for simple structural languages defined by start/end tags.
  • task Subprocess utilities.
  • transform Transformer creates a pipeline of functional stages for an input stream, through which each record is transformed and notable transformations are logged.
  • type_util Type utilities.
  • util Miscellaneous utilities.