Welcome to dhp’s documentation!

Dirty Hungarian Phrasebook

dhp is a library of snippets, almost guaranteed to get you into trouble.

I obtained it, from a vendor, on the corner, outside of PyCon.

Actually, this is a growing repository of routines that I find helpful from time to time. I think you might too.

Phrasebook Examples

dhp.doq – Use ORM like expressions to query simple data sources.

dhp.search – Search related method and functions.

dhp.structures – Unique structures that build on Python’s built-ins.

  • DictDot - Ever wish the dictionary supported dot access?

dhp.test – Helpful test helper routines.

  • tempfile_containing - generate a temporary file that contains indicated contents and returns the filename for use. When finished the tempfile is removed.

dhp.transforms

  • to_snake - transform a “camelCased” name into a pythonized version, “camel_cased”.

dhp.VI

  • iteritems - return the proper iteritems method for a dictionary based on the version of Python

dhp.xml

  • xml_to_dict - parse any ugly, but valid, xml to a python dictionary.
  • ppxml - format/reformat any ugly but valid xml, a pretty printer for xml

Supports

Tested on Python 2.7, 3.2, 3.3, 3.4

Build Status

Requirements

None.

Installation

Make sure to get the latest version.

pip install dhp

License

BSD

Documentation

Change Log

See Change Log

Contributing

See Contributing

Indices and tables