Skip to main content

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.1.tar.gz (6.2 kB view details)

Uploaded Source

File details

Details for the file dicts-0.3.1.tar.gz.

File metadata

  • Download URL: dicts-0.3.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dicts-0.3.1.tar.gz
Algorithm Hash digest
SHA256 0f962662b89135611ac8a142201e240f0fd02e440d1a84fb9f8bf2ebc97f3888
MD5 0f335eb79779923babffdbe5c41dd143
BLAKE2b-256 e0aa9fd094c2dcb22b7a3cecdebd5e67a015ee0db82ea325573924201dbe5c45

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page