Skip to main content

Tab completable ordered dictionary.

Project description


The is a simplification and redesign of the orderedbunch package from tinytools. The package ontains an OrderedBunch object class with associated bunchify/unbunchify methods, similar to other bunch implementations but built off an OrderedDict with ipython table-complete overloaded to the data memebers. It removes the ordered_dictionarify function that is in tinytools and and leaves the development of the nested dictionaries to external code. The motivation is that it is quite complicated to infer what the user is wanting - and therefore error prone.

IPython has also recently changed its handling of the __dir__ method and it is unclear under which cases it is respected for tab completion or not. It seems, though, that for ipython 6, it is possible to remove mothods from the tab completion through the IPCompleter.* configuration options.


pip install orderedbunch


import orderedbunch

Quick Start

from orderedbunch import OrderedBunch

## OrderedBunch
from collections import OrderedDict

# Create an OrderedBunch from and return it to an OrderedDict
od = OrderedDict({'a':1,'b':2,'c':{'aa':1.23,'bb':'string'}})
ob = orderedbunch.ordered_bunchify(od)
ob.a          # Explore the OrderdBunch with tab complete
ob['a']       # Equivalent to above       # orderd_bunchify is recursive on nested Dict objects
ob['c']['bb'] # Equivalent to above
od2 = tt.bunch.ordered_unbunchify(ob)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for orderedbunch, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size orderedbunch-1.0.1-py3-none-any.whl (5.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size orderedbunch-1.0.1.tar.gz (5.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page