Skip to content

tivvit/python-case-insensitive-dict

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

Python case insensitive dictionary

https://api.travis-ci.org/tivvit/python-case-insensitive-dict.svg?branch=master

  • implements all standard dictionary methods
  • supports nested dicts
  • this implementation does not preserve original key case

Install

pip install CaseInsensitiveDict

Example

from CaseInsensitiveDict import CaseInsensitiveDict

cid = CaseInsensitiveDict({"A": {"A": 1}, "B": 2, "c": 3})

print cid["A"] # >>> {'a': 1}
print cid["a"] # >>> {'a': 1}
print cid["A"]["a"] # >>> 1
print cid["b"] # >>> 2
print cid["C"] # >>> 3

Development

Feel free to contribute.

Copyright and License

2015 Vít Listík

Released under MIT licence

About

Python case insensitive dictionary

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages