Updated README and CHANGELOG.

This commit is contained in:
Fabio Caccamo 2020-01-13 14:56:12 +01:00
parent 739f55b7a6
commit 8226d3f177
1 changed files with 27 additions and 2 deletions

View File

@ -38,10 +38,13 @@ python-benedict is a dict subclass with **keypath** support, **I/O** shortcuts (
- [`merge`](#merge) - [`merge`](#merge)
- [`move`](#move) - [`move`](#move)
- [`remove`](#remove) - [`remove`](#remove)
- [`rename`](#rename)
- [`search`](#search)
- [`standardize`](#standardize) - [`standardize`](#standardize)
- [`subset`](#subset) - [`subset`](#subset)
- [`swap`](#swap) - [`swap`](#swap)
- [`traverse`](#traverse) - [`traverse`](#traverse)
- [`unflatten`](#unflatten)
- [`unique`](#unique) - [`unique`](#unique)
- [I/O](#io) - [I/O](#io)
- [`from_base64`](#from_base64) - [`from_base64`](#from_base64)
@ -233,7 +236,7 @@ f = d.filter(predicate)
- #### flatten - #### flatten
```python ```python
# Return a flatten dict using the given separator to concat nested dict keys. # Return a new flattened dict using the given separator to join nested dict keys to flatten keypaths.
f = d.flatten(separator='_') f = d.flatten(separator='_')
``` ```
@ -284,7 +287,7 @@ d.merge(a, b, c)
# Move an item from key_src to key_dst. # Move an item from key_src to key_dst.
# It can be used to rename a key. # It can be used to rename a key.
# If key_dst exists, its value will be overwritten. # If key_dst exists, its value will be overwritten.
d.move('a', 'b') d.move('a', 'b', overwrite=True)
``` ```
- #### remove - #### remove
@ -295,6 +298,21 @@ d.move('a', 'b')
d.remove(['firstname', 'lastname', 'email']) d.remove(['firstname', 'lastname', 'email'])
``` ```
- #### rename
```python
# Rename a dict item key from 'key' to 'key_new'.
# If key_new exists, a KeyError will be raised.
d.rename('first_name', 'firstname')
```
- #### search
```python
# Search and return a list of items (dict, key, value, ) matching the given query.
d.search('hello', in_keys=True, in_values=True, exact=False, case_sensitive=False)
```
- #### standardize - #### standardize
```python ```python
@ -326,6 +344,13 @@ def f(d, key, value):
d.traverse(f) d.traverse(f)
``` ```
- #### unflatten
```python
# Return a new unflattened dict using the given separator to split dict keys to nested keypaths.
d.unflatten(separator='_')
```
- #### unique - #### unique
```python ```python