FlatDict
FlatDict and FlatterDict are dict classes that allow 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 flatdict
Release files for flatdict 4.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flatdict-4.1.0.tar.gz | 33.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flatdict-4.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.2 kB
Release files / flatdict-4.1.0.tar.gz
| Download URL | flatdict-4.1.0.tar.gz |
|---|---|
| Size | 33.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
63bcd906a0859d91d0aace44b327178706c7fcf85a88c7ccf0825628376ad66b
|
|
BLAKE2b-256 checksum How to use checksums |
1fbae0461697020839f60741e493fc42b20a4cd3f91594ed3228f65ae9a50aee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 15, 2026.
Transparency logRelease files / flatdict-4.1.0-py3-none-any.whl
| Download URL | flatdict-4.1.0-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
24c3ff816733e472f91071031bd286c3826ecf2d646d5020af49fe10b20a5677
|
|
BLAKE2b-256 checksum How to use checksums |
12b56b6c496304047982b67d984ed2f77c183f73d69f7dbbc0cd2928252cc6b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 15, 2026.
Transparency log