library grew into pyutils: a set of collections, helpers and utilities
that I find useful and hope you will too.
-Code is under `src/pyutils/`. Most code includes documentation and inline
-doctests. I've tried to organize it into logical packages based on the
-code's functionality.
+Code is under `src/pyutils/
+<https://wannabe.guru.org/gitweb/?p=pyutils.git;a=tree;f=src/pyutils;h=e716e14b7a895e5c6206af90f4628bf756f040fe;hb=HEAD>`_.
+Most code includes inlint documentation and doctests. I've tried to
+organize it into logical packages based on the code's functionality.
+Note that when words would collide with a Python library or reserved
+word I've used a 'z' at the end, e.g. 'collectionz' instead of
+'collections', 'typez' instead of 'type', etc...
-Unit and integration tests are under `tests/*`. To run all tests::
+There's some example code that uses various features of this project checked
+in under `examples/ <https://wannabe.guru.org/gitweb/?p=pyutils.git;a=tree;f=examples;h=d9744bf2b171ba7a9ff21ae1d3862b673647fff4;hb=HEAD>`_ that you can check out.
+
+Unit and integration tests are under `tests/
+<https://wannabe.guru.org/gitweb/?p=pyutils.git;a=tree;f=tests;h=8c303f23cd89b6d2e4fbf214a5c7dcc0941151b4;hb=HEAD>`_.
+To run all tests::
cd tests/
./run_tests.py --all [--coverage]
-See the README under `tests/` and the code of `run_tests.py` for more
+See the `README <https://wannabe.guru.org/gitweb/?p=pyutils.git;a=blob_plain;f=tests/README;hb=HEAD>`_ under `tests/` and the code of `run_tests.py` for more
options / information about running tests.
This package generates Sphinx docs which are available at:
https://wannabe.guru.org/gitweb/?p=python_utils.git;a=summary
-The LICENSE and NOTICE files at the root of the project describe
-reusing this code and where everything came from. Drop me a line
-if you are using this, find a bug, have a question, or have a
-suggestion:
+The `LICENSE
+<https://wannabe.guru.org/gitweb/?p=pyutils.git;a=blob_plain;f=LICENSE;hb=HEAD>`_
+and `NOTICE
+<[https://wannabe.guru.org/gitweb/?p=pyutils.git;a=blob_plain;f=NOTICE;hb=HEAD>`_
+files at the root of the project describe reusing this code and where
+everything came from. Drop me a line if you are using this, find a
+bug, have a question, or have a suggestion:
-----------
.. toctree::
- :maxdepth: 4
+ :maxdepth: 5
:name: mastertoc
pyutils.collectionz
pyutils.dict\_utils module
--------------------------
-A bunch of helpers for dealing with Python dicts.
-
----
-
.. automodule:: pyutils.dict_utils
:members:
:undoc-members:
pyutils.exec\_utils module
--------------------------
-Helper code for dealing with subprocesses.
-
----
-
.. automodule:: pyutils.exec_utils
:members:
:undoc-members:
pyutils.function\_utils module
------------------------------
-Helper util for dealing with functions.
-
----
-
.. automodule:: pyutils.function_utils
:members:
:undoc-members:
pyutils.id\_generator module
----------------------------
-Generate unique identifiers.
-
----
-
.. automodule:: pyutils.id_generator
:members:
:undoc-members:
pyutils.iter\_utils module
--------------------------
-Iterator utilities including a :py:class:`PeekingIterator`, :py:class:`PushbackIterator`,
-and :py:class:`SamplingIterator`.
-
----
-
.. automodule:: pyutils.iter_utils
:members:
:undoc-members:
pyutils.list\_utils module
--------------------------
-Utilities for dealing with Python lists.
-
----
-
.. automodule:: pyutils.list_utils
:members:
:undoc-members:
pyutils.logging\_utils module
-----------------------------
-This is a module that offers an opinionated take on how whole program
-logging should be initialized and controlled. It uses standard Python
-:py:mod:`logging` but gives you control, via commandline config, to:
-
- - Set the logging level of the program including overriding the
- logging level for individual modules,
- - Define the logging message format including easily adding a
- PID/TID marker on all messages to help with multithreaded debugging,
- - Control the destination (file, `sys.stderr`, syslog) of messages,
- - Control the facility and logging level used with syslog,
- - Squelch repeated messages,
- - Log probalistically,
- - Clear rogue logging handlers added by other imports.
-
----
-
.. automodule:: pyutils.logging_utils
:members:
:undoc-members:
pyutils.math\_utils module
--------------------------
-Helper utilities that are "mathy" such as a :py:class:`NumericPopulation` that
-makes population summary statistics available to your code quickly, GCD
-computation, literate float truncation, percentage <-> multiplier, prime
-number determination, etc...
-
----
-
.. automodule:: pyutils.math_utils
:members:
:undoc-members:
pyutils.misc\_utils module
--------------------------
-Miscellaneous utilities: are we running as root, and is a debugger attached?
-
----
-
.. automodule:: pyutils.misc_utils
:members:
:undoc-members:
pyutils.persistent module
-------------------------
-Persistent defines a class hierarchy and decorator for creating
-singleton classes that (optionally / conditionally) load their state
-from some external location and (optionally / conditionally) save their
-state to an external location at shutdown.
-
----
-
.. automodule:: pyutils.persistent
:members:
:undoc-members:
pyutils.remote\_worker module
-----------------------------
-This module defines a helper that is invoked by the remote executor to
-run pickled code on a remote machine. It is used by code marked with
-`@parallelize(method=Method.REMOTE)` in the parallelize framework.
-
----
-
.. automodule:: pyutils.remote_worker
:members:
:undoc-members:
pyutils.state\_tracker module
-----------------------------
-This module defines several classes (:py:class:`StateTracker`,
-:py:class:`AutomaticStateTracker`, and
-:py:class:`WaitableAutomaticStateTracker`) that can be used as base
-classes. These class patterns are meant to encapsulate and represent
-state that dynamically changes. These classes update their state
-(either automatically or when invoked to poll) and allow their callers
-to wait on state changes.
-
----
-
.. automodule:: pyutils.state_tracker
:members:
:undoc-members:
pyutils.string\_utils module
----------------------------
-A bunch of utilities for dealing with strings. Based on a really great
-starting library from Davide Zanotti, I've added a pile of other string
-functions so hopefully it will handle all of your string-needs.
+A bunch of utilities for dealing with strings. Based on a really
+great starting library from Davide Zanotti (forked from
+https://github.com/daveoncode/python-string-utils/tree/master/string_utils),
+I've added a pile of other string functions (see `NOTICE
+<[https://wannabe.guru.org/gitweb/?p=pyutils.git;a=blob_plain;f=NOTICE;hb=HEAD>`_
+file in the root of this project for a detailed account of what was
+added and changed) so hopefully it will handle all of your
+string-needs.
---
pyutils.text\_utils module
--------------------------
-Utilities for dealing with and creating text chunks. For example:
-
- - Make a bar graph,
- - make a spark line,
- - left, right, center, justify text,
- - word wrap text,
- - indent text,
- - create a header line,
- - draw a box around some text.
-
----
-
.. automodule:: pyutils.text_utils
:members:
:undoc-members:
pyutils.unittest\_utils module
------------------------------
-Utilities to support smarter unit tests.
-
----
-
.. automodule:: pyutils.unittest_utils
:members:
:undoc-members:
pyutils.unscrambler module
--------------------------
-Unscramble scrambled English words quickly.
-
----
-
.. automodule:: pyutils.unscrambler
:members:
:undoc-members:
pyutils.zookeeper module
------------------------
-A helper module for dealing with Zookeeper that adds some functionality.
-
----
-
.. automodule:: pyutils.zookeeper
:members:
:undoc-members:
Module contents
---------------
----
-
.. automodule:: pyutils
:members:
:undoc-members: