File: PKG-INFO

package info (click to toggle)
python-flatdict 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 216 kB
  • sloc: python: 689; makefile: 4
file content (93 lines) | stat: -rw-r--r-- 2,913 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
Metadata-Version: 2.4
Name: flatdict
Version: 4.1.0
Summary: Python module for interacting with nested dicts as a single level dict with delimited keys.
Project-URL: Homepage, https://github.com/gmr/flatdict
Project-URL: Documentation, https://flatdict.readthedocs.io
Author-email: "Gavin M. Roy" <gavinmroy@gmail.com>
License-Expression: BSD-3-Clause
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# 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:*

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

*would be the same as:*

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

*values can be accessed as:*

```python
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:*

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

*will be the same as:*

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

```bash
pip install flatdict
```