Easy use dictionaries with specific features
Project description
All kind of dictionaries you always think but never do.
Check the full documentation site
Instalation
To install dicts form Pypi:
easy_install dicts
or
pip install dicts
if you want to install it from source code:
python setup.py install
Usage
Dictionaries Features
join:
>>> d1 = Dict({1 : 7, 2 : [1,2], 3 : 'a'}) >>> d1.join({1 : 2, 2 : [3], 3 : 'b'}) {1: 9, 2: [1, 2, 3], 3: 'ab'}
map:
>>> d = Dict({'1' : 1, '2' : 2}) >>> d.map(lambda x: 1/3.0) >>> d {'1': 0.3333333333333333, '2': 0.3333333333333333}
fromrepetitions:
>>> Dict.fromrepetitions([1,1,1,1,2]) {1: 4, 2: 1}
relookup:
>>> d = Dict({'1': 1, '2' : 2, 'c' : 3}) >>> d.relookup('\d') [('1', 1), ('2', 2)]
Especific dictionaries
SortedDict family
NoCaseDict
RegexpDict
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dicts-0.3.tar.gz
(6.1 kB
view details)
File details
Details for the file dicts-0.3.tar.gz
.
File metadata
- Download URL: dicts-0.3.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f2085061045ebaf3de0252572df0d1b79924143521ad507d49d067e444000fe |
|
MD5 | aaf3915b8f4420288bb6051e5034a7f5 |
|
BLAKE2b-256 | 0e68467d35a222df604ad5fb12c109fa44fc1a7aa11a4237a942205ecb26e3e3 |