twodict

Simple two way ordered dictionary for Python


Keywords
python, dictionary, ordered
License
Unlicense
Install
pip install twodict==1.2

Documentation

twodict (Two Way Ordered Dict)

Simple two way ordered dictionary for Python.

See wiki for more informations.

INSTALLATION

Install From Source

  1. Download & extract source from here
  2. Change directory into twodict-1.2/
  3. Run sudo python setup.py install

Install From Pypi

  1. Run sudo pip install twodict

USAGE

from twodict import TwoWayOrderedDict

tdict = TwoWayOrderedDict()
tdict['a'] = 1
tdict['b'] = 2
tdict['c'] = 3

print(tdict['a'])  # Outputs 1
print(tdict[1])  # Outputs 'a'

del tdict[2]
print(tdict)  # TwoWayOrderedDict([('a', 1), ('c', 3)])

AUTHOR

Sotiris Papadopoulos

LICENSE

Unlicense (public domain)