Skip to main content

Shorthand syntax for building OrderedDicts

Project description

https://github.com/epsy/od/actions/workflows/ci.yml/badge.svg?branch=master https://coveralls.io/repos/github/epsy/od/badge.svg?branch=master

The od package adds a shorthand syntax to create instances of OrderedDict

>>> import od
>>>
>>> od["cat": "fish", "mouse": "cheese"]
OrderedDict([('cat', 'fish'), ('mouse', 'cheese')])
>>> od["mouse": "cheese", "cat": "fish"]
OrderedDict([('mouse', 'cheese'), ('cat', 'fish')])

You can also use it like the regular constructor for OrderedDict:

>>> od()
OrderedDict()
>>> an_iterable = [("cat", "fish"), ("mouse", "cheese")]
>>> od(an_iterable)
OrderedDict([('cat', 'fish'), ('mouse', 'cheese')])

Install this package using pip:

$ pip install --user od

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

od-2.0.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

od-2.0.2-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file od-2.0.2.tar.gz.

File metadata

  • Download URL: od-2.0.2.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.6.9

File hashes

Hashes for od-2.0.2.tar.gz
Algorithm Hash digest
SHA256 b86923d99f262e0e75215f853aac19975853ef35728e60f509c63f55b1f8b4a9
MD5 8c5bb58a63d144c610540109313b295f
BLAKE2b-256 316586e6a714f93a0b497cb0ec0a2ee6580179c568969525c7e87b783749e89d

See more details on using hashes here.

File details

Details for the file od-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: od-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.6.9

File hashes

Hashes for od-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 af8febd09a137ed2931c5b08b2c0c2a498d4707ac0fb8827352a80316d0e1edc
MD5 68742f2353025f8f75bd6673a1b3616d
BLAKE2b-256 8bb1219294f55a1f32f6203738e294b7636192690902da9e2ddbfc68860270e8

See more details on using hashes here.

Supported by

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