Skip to main content

FlatDict

Version Build Status Coverage License

FlatDict and FlatterDict are a dict classes that allows for single level, delimited key/value pair mapping of nested dictionaries. You can interact with FlatDict and FlatterDict like a normal dictionary and access child dictionaries as you normally would or with the composite key.

For example:

value = flatdict.FlatDict({'foo': {'bar': 'baz', 'qux': 'corge'}})

would be the same as:

value == {'foo:bar': 'baz', 'foo:qux': 'corge'}

values can be accessed as:

print(foo['foo:bar'])

# or

print(foo['foo']['bar'])

Additionally, lists and tuples are also converted into dicts using enumerate(), using the FlatterDict class.

For example:

value = flatdict.FlatterDict({'list': ['a', 'b', 'c']})

will be the same as:

value == {'list:0': 'a', 'list:1': 'b', 'list:2': 'c'}

API

Documentation is available at https://flatdict.readthedocs.io

Versioning

This package attempts to use semantic versioning. API changes are indicated by the major version, non-breaking improvements by the minor, and bug fixes in the revision.

It is recommended that you pin your targets to greater or equal to the current version and less than the next major version.

Installation

$ pip install flatdict2

Or using Poetry:

$ poetry add flatdict2

Metadata

Release files for flatdict3 0.1.0

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

Source distribution (sdist)

Source distribution for flatdict3 0.1.0
File Size Uploaded Provenance Actions
flatdict3-0.1.0.tar.gz 6.0 kB Without provenance Details for flatdict3-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flatdict3 0.1.0
File Interpreter ABI Platform Actions
flatdict3-0.1.0-py3-none-any.whl Python 3 none any Details for flatdict3-0.1.0-py3-none-any.whl

Total release size: 12.5 kB

Release files / flatdict3-0.1.0.tar.gz

Download URL flatdict3-0.1.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8882f1af8f3702cdfce0588fa2638734a736d4d7c5d6e84e3c17d54224d03295
BLAKE2b-256 checksum
How to use checksums
37678b6f1158edcd9780e89a6375e24f9ea4b29625bef55c19acd6cd06f32ce6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.13.11 Linux/6.16.12-200.fc42.x86_64

Release files / flatdict3-0.1.0-py3-none-any.whl

Download URL flatdict3-0.1.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b3ac2f1e8f57fafc020c0051539ac4f698c6f93f675050482c85a813df35734
BLAKE2b-256 checksum
How to use checksums
f8702f43005eeebf121b28814bf530fc332ddb921765ce368891d28f517b5457
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.13.11 Linux/6.16.12-200.fc42.x86_64

Security for flatdict3 0.1.0

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

0.1.0 This release

2 release files 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