Skip to main content

SuperDict - it’s like dict, but better.

You don’t change you dictionary to something new, you just make it better.

Module contains only 15 lines of code and valid by PEP8.

Installation

$ pip install superdict

Usage

>>> from superdict import SuperDict
>>>
>>> data = SuperDict()
>>>
>>> data.so.how.it = 'works'
>>> data
{'so': {'how': {'it': 'works'}}}
>>> data.so
{'how': {'it': 'works'}}
>>>
>>> data.test.me.please = 42
>>> data
{'test': {'me': {'please': 42}}, 'so': {'how': {'it': 'works'}}}
>>>
>>> del data.test.me
>>> data
{'test': {}, 'so': {'how': {'it': 'works'}}}
>>>
>>> data['so']['how']
{'it': 'works'}
>>>
>>> default_data = SuperDict({'default': {'x': 'y'}})
>>> default_data
{'default': {'x': 'y'}}
>>> default_data.default.x
'y'
>>>
>>> default_data = SuperDict({'default': SuperDict({'x': 'y'})})
>>> default_data
{'default': {'x': 'y'}}
>>> default_data.default.x
'y'
>>>
>>> real_dict = SuperDict({'is_success': True})
>>> copied_dict = real_dict.copy()
>>> copied_dict.is_success
True

In another cases this class works like a dict.

>>> default_data['unknown-key']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'unknown-key'
>>>
>>> default_data['set'] = 'correct'
>>> default_data['new-set']['value'] = 'wrong'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'new-set'

Metadata

Release files for SuperDict 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SuperDict 1.0.3
File Size Uploaded Provenance
SuperDict-1.0.3.tar.gz 747 Bytes Without provenance Details

Release files / SuperDict-1.0.3.tar.gz

Download URL SuperDict-1.0.3.tar.gz
Size 747 Bytes
Tags Source
SHA-256 checksum
How to use checksums
7074216be7c9c99b33e502772436b4c17d5e5efceb7620b3e8b4b30634495ebc
BLAKE2b-256 checksum
How to use checksums
943ce59a9d3d4022f208fb6b2a2a2ab6a54b0f06165955e116d737bc481be684
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for SuperDict 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.3 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page