---
title: "flatdict | pypx"
description: "Python module for interacting with nested dicts as a single level dict with delimited keys."
canonical_url: "https://pypx.app/packages/flatdict"
meta:
  "og:description": "Python module for interacting with nested dicts as a single level dict with delimited keys."
  "og:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_flatdict%2Cversion_4.1.0%2Csummary_Python%2Bmodule%2Bfor%2Binteracting%2Bwith%2Bnested%2Bdicts%2Bas%2Ba%2Bsingle%2Blevel%2Bdict%2Bwith%2Bdelimited%2Bkeys.%2Clicense_BSD-3-Clause%2Cp_Ii9wYWNrYWdlcy9mbGF0ZGljdCI%2Cs_1o3swgkRQqan6xwV.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "flatdict 4.1.0"
  "twitter:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_flatdict%2Cversion_4.1.0%2Csummary_Python%2Bmodule%2Bfor%2Binteracting%2Bwith%2Bnested%2Bdicts%2Bas%2Ba%2Bsingle%2Blevel%2Bdict%2Bwith%2Bdelimited%2Bkeys.%2Clicense_BSD-3-Clause%2Cp_Ii9wYWNrYWdlcy9mbGF0ZGljdCI%2Cs_1o3swgkRQqan6xwV.png"
---

> Index of every page on this site: [llms.txt](https://pypx.app/llms.txt)

# **flatdict**

v4.1.0

Python module for interacting with nested dicts as a single level dict with delimited keys.

7 KB Python 3.10+ py3-none-anyBSD-3-Clause

[**Diff **](https://pypx.app/packages/flatdict/diff)

`$ uv add flatdict`

# FlatDict

[![Version](https://img.shields.io/pypi/v/flatdict.svg?)](https://pypi.python.org/pypi/flatdict) [![Status](https://github.com/gmr/flatdict/workflows/Testing/badge.svg)](https://github.com/gmr/flatdict/actions) [![Coverage](https://img.shields.io/codecov/c/github/gmr/flatdict.svg?)](https://codecov.io/github/gmr/flatdict?branch=master) [![License](https://img.shields.io/pypi/l/flatdict.svg?)](https://flatdict.readthedocs.org)

`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
```

## **Details **

<dl>

<dt>Version</dt>
<dd>4.1.0</dd>

<dt>License</dt>
<dd>BSD-3-Clause</dd>

<dt>Python</dt>
<dd>&gt;=3.10</dd>

<dt>Maintainer</dt>
<dd>"Gavin M. Roy" &lt;gavinmroy@gmail.com&gt;</dd></dl>

## **Links**

- [Documentation](https://flatdict.readthedocs.io)
- [Homepage](https://github.com/gmr/flatdict)
- [View on PyPI](https://pypi.org/project/flatdict/)

## **Release Cadence **

**1**

releases in the past year

avg 290 days between releases

## **Maintainers **

- "Gavin M. Roy" · [gavinmroy@gmail.com](mailto:gavinmroy@gmail.com)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://pypx.app/#website","@type":"WebSite","description":"The Python Package Index, reimagined. Fast search, dependency insights, download trends, and changelogs — all in one place.","name":"pypx","url":"https://pypx.app/"},{"@id":"https://pypx.app/packages/flatdict#webpage","@type":"WebPage","description":"Python module for interacting with nested dicts as a single level dict with delimited keys.","name":"flatdict","url":"https://pypx.app/packages/flatdict","isPartOf":{"@id":"https://pypx.app/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://pypx.app/packages/flatdict"]}]},{"@id":"https://pypx.app/packages/flatdict#/schema/software-application/1","@type":"SoftwareApplication","applicationCategory":"DeveloperApplication","description":"Python module for interacting with nested dicts as a single level dict with delimited keys.","license":"BSD-3-Clause","name":"flatdict","softwareVersion":"4.1.0"}]}
```

## Sitemap

See the full [sitemap](https://pypx.app/sitemap.md) for all pages.
