Skip to main content

A dict-like object that ignore NoneType values for Python

Project description

optionaldict

Build Status Build status Coverage Status

optionaldict is a dict-like object that ignore NoneType values for Python which is pickable and JSON serializable.

Installation

You can install optionaldict simply using pip:

pip install optionaldict

Usage

optionaldict's usage is very simple, you will import it by:

from optionaldict import optionaldict

or if you prefer the CamelCasing style naming, you can import it by:

from optionaldict import OptionalDict

Tips: In fact, optionaldict is just an alias for OptionalDict.

Then you can use it just like the built-in dict:

d1 = optionaldict(a=1, b=None)
d1['c'] = 2
d1.setdefault('d', None)

d2 = optionaldict()
d2['a'] = 1
d2['b'] = None

d3 = optionaldict({
    'a': 1,
    'b': None
})

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

optionaldict-0.1.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

optionaldict-0.1.2-py2.py3-none-any.whl (3.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file optionaldict-0.1.2.tar.gz.

File metadata

  • Download URL: optionaldict-0.1.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.16

File hashes

Hashes for optionaldict-0.1.2.tar.gz
Algorithm Hash digest
SHA256 175b62ee8259af703def42e0b44b413ea55e7b0732456cb2fd5cbbc998605966
MD5 421af5fc122af0be9399d825d3793cae
BLAKE2b-256 ad8bcb72b1d40d21963ad1923ce529ae1f9ba49a13c18c7e6c47081c3dc1211f

See more details on using hashes here.

File details

Details for the file optionaldict-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: optionaldict-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.16

File hashes

Hashes for optionaldict-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 278d9b79b3d6a55b1b8ff5f9017bff6383a33426348d09e699ff50162bbcdab7
MD5 8c3663294097f28a14adf4b422cb78ac
BLAKE2b-256 93c2408eb8d1ddacc36c6c31e0b0640b8493a4b3e88e26670bdd2b3a8ad7d704

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