From 1a162c042456864944405a8440b29b76f8148dbe Mon Sep 17 00:00:00 2001 From: Fabio Caccamo Date: Tue, 24 Sep 2019 16:55:11 +0200 Subject: [PATCH] Updated README. [ci skip] --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a7e4fec..8268017 100644 --- a/README.md +++ b/README.md @@ -91,8 +91,7 @@ d = benedict() # or cast an existing dict d = benedict(existing_dict) -# or create from data source (filepath, url or data-string) -# in a supported format (json, toml, xml, yaml) +# or create from data source (filepath, url or data-string) in a supported format (json, toml, xml, yaml) d = benedict('https://localhost:8000/data.json') # or in a Django view @@ -414,7 +413,7 @@ d.clean(strings=True, dicts=True, lists=True) ```python # Return a clone (deepcopy) of the dict. -d.clone() +c = d.clone() ``` - ##### dump @@ -435,14 +434,14 @@ print(d.dump()) # Return a filtered dict using the given predicate function. # Predicate function receives key, value arguments and should return a bool value. predicate = lambda k, v: v is not None -d.filter(predicate) +f = d.filter(predicate) ``` - ##### flatten ```python # Return a flatten dict using the given separator to concat nested dict keys. -d.flatten(separator='_') +f = d.flatten(separator='_') ``` - ##### merge @@ -464,7 +463,7 @@ d.remove(['firstname', 'lastname', 'email']) ```python # Return a dict subset for the given keys. -d.subset(['firstname', 'lastname', 'email']) +s = d.subset(['firstname', 'lastname', 'email']) ``` ## Testing