Popular recipes tagged "mapping" but not "dict"http://code.activestate.com/recipes/tags/mapping-dict/2012-10-24T00:44:30-07:00ActiveState Code Recipesxml to python dictionary and back (Python)
2012-10-24T00:44:30-07:00kris kvilekvalhttp://code.activestate.com/recipes/users/4178118/http://code.activestate.com/recipes/577722-xml-to-python-dictionary-and-back/
<p style="color: grey">
Python
recipe 577722
by <a href="/recipes/users/4178118/">kris kvilekval</a>
(<a href="/recipes/tags/dictionary/">dictionary</a>, <a href="/recipes/tags/mapping/">mapping</a>, <a href="/recipes/tags/xml/">xml</a>).
Revision 2.
</p>
<p>Simple mapping of XML to python dictionary based on Perl XML::Simple</p>
An interval mapping data structure (Python)
2010-12-23T12:51:27-08:00Matteo Dell'Amicohttp://code.activestate.com/recipes/users/2433284/http://code.activestate.com/recipes/577515-an-interval-mapping-data-structure/
<p style="color: grey">
Python
recipe 577515
by <a href="/recipes/users/2433284/">Matteo Dell'Amico</a>
(<a href="/recipes/tags/algorithms/">algorithms</a>, <a href="/recipes/tags/interval/">interval</a>, <a href="/recipes/tags/mapping/">mapping</a>).
</p>
<p>This structure is a kind of dictionary which allows you to map data intervals to values. You can then query the structure for a given point, and it returns the value associated to the interval which contains the point. Boundary values don't need to be an integer.</p>
<p>In this version, the excellent <a href="http://pypi.python.org/pypi/blist/">blist</a> library by Daniel Stutzbach is used for efficiency. By using the collections.MutableMapping abstract base class, the whole signature of mappings is supported.</p>