[documentation](doc)

Overview
========

Python Commons is a general-purpose library for Python. To get a sense of
what it provides, please glance over the [documentation](doc).

Requirements
============

- [Python](http://python.org/) 2.6
- [setuptools](http://peak.telecommunity.com/DevCenter/setuptools) 0.6

Certain sub-modules have extra requirements:

- `async` requires [Twisted](http://twistedmatrix.com/trac/) 2.5

This library has only been tested on Linux.

Setup
=====

To install, run `easy_install python-commons`, or download the source tarball
and run `python setup.py install`.

Related
=======

The code here generally tries to complement the code already available in a
number of other general-purpose utility libraries for Python:

- [AIMA Utilities]: accompanies a popular AI textbook
- [itools]
- [Grizzled]
- [PyUtilib]
- [Py]

See also:

- [ASPN Cookbook]: a valuable repository of Python snippets

[ASPN Cookbook]: http://aspn.activestate.com/ASPN/Cookbook/Python
[AIMA Utilities]: http://aima.cs.berkeley.edu/python/utils.py
[itools]: http://www.hforge.org/itools
[Grizzled]: http://bmc.github.com/grizzled/
[PyUtilib]: https://software.sandia.gov/trac/pyutilib
[Py]: http://codespeak.net/py/dist/

Changes
=======

version 0.7, 2010-04-17

- released for gbookmark2delicious
- enhanced free_struct
- added recursion_guard decorator
- complete html2unicode
- wrap keys and values as strings in sqlhash
- logger should append by default
- added inet_nltoa, inet_hltoa
- internally use commons.path instead of (unmaintained) path.py

version 0.6, 2009-06-03

- to strs added unwrap, indent, unindent, remove_empty_lines, underline,
  dos2unix, quotejs, unicode2html, html2unicode, nat_lang_join, or_join,
  and_join
- to misc added sendmail, days, settimeout, run, TerminalController
- imported and updated jorendorff's path.py
- to startup added command_name
- to files added read_file, write_file, write_or_rm, is_nonempty_file
- added sqlhash and sqlhash backend for shelf
- to structs added dicts2structs, structs2dicts; FreeStruct renamed to
  free_struct
- to seqs added span, group_as_subseqs
- decs.pickle_memoized uses protocol 2
- general tweaks; epydoc fixes
- python 2.6-ready
- released for [Mailing List Filter], [MIT 6.00] courseware

[Mailing List Filter]: http://assorted.sourceforge.net/mailing-list-filter/
[MIT 6.00]: http://web.mit.edu/~6.00/

version 0.5, 2008-05-14

- added `cp1252_to_unicode()`
- made `setup()` more flexible
- released for
  [gbookmark2delicious](http://gbookmark2delicious.googlecode.com/)

version 0.4, 2008-05-08

- removed extraneous debug print statements
- added `logout()` context manager
- added `seq()`, `default_if_none()`
- fixed missing `import` bug
- released for [Mailing List
  Filter](http://assorted.sf.net/mailing-list-filter/)

version 0.3, 2008-04-30

- added versioned guards
- added file memoization
- added retry with exp backoff
- added `countstep()`
- released for
  [gbookmark2delicious](http://gbookmark2delicious.googlecode.com/)

version 0.2, 2008-02-04

- added `clients`, `setup`
- released for [icedb](http://cartel.csail.mit.edu/icedb/)

version 0.1, 2007-03-24

- initial release
