@@ -25,9 +25,11 @@ The Python dictionary for humans dealing with evil/complex data.
2525 - [ I/O] ( #io )
2626 - [ ` from_json ` ] ( #from_json )
2727 - [ ` from_toml ` ] ( #from_toml )
28+ - [ ` from_xml ` ] ( #from_xml )
2829 - [ ` from_yaml ` ] ( #from_yaml )
2930 - [ ` to_json ` ] ( #to_json )
3031 - [ ` to_toml ` ] ( #to_toml )
32+ - [ ` to_xml ` ] ( #to_xml )
3133 - [ ` to_yaml ` ] ( #to_yaml )
3234 - [ Parse] ( #parse )
3335 - [ ` get_bool ` ] ( #get_bool )
@@ -63,7 +65,7 @@ The Python dictionary for humans dealing with evil/complex data.
6365
6466## Features
6567- Full ** keypath** support * (using the dot syntax by default)*
66- - Easy ** I/O operations** with most common formats: ` json ` , ` toml ` , ` yaml `
68+ - Easy ** I/O operations** with most common formats: ` json ` , ` toml ` , ` xml ` , ` yaml `
6769- Many ** utility** and ** parse methods** to retrieve data as needed * (all methods listed below)*
6870- Give ** benediction** :) to ` dict ` values before they are returned * (they receive benedict casting)*
6971- 100% ** backward-compatible** * (you can replace existing dicts without pain)*
@@ -142,12 +144,12 @@ d = benedict(existing_dict, keypath_separator=None)
142144## API
143145
144146### I/O
145- These methods simplify I/O operations with most common formats: ` json ` , ` toml ` , ` yaml `
147+ These methods simplify I/O operations with most common formats: ` json ` , ` toml ` , ` xml ` , ` yaml `
146148
147149- ##### from_json
148150
149151``` python
150- # Try to load/decode a json encoded string and return it as dict instance.
152+ # Try to load/decode a json encoded data and return it as dict instance.
151153# Accept as first argument: url, filepath or string.
152154# A ValueError is raised in case of failure.
153155benedict.from_json(s)
@@ -156,16 +158,25 @@ benedict.from_json(s)
156158- ##### from_toml
157159
158160``` python
159- # Try to load/decode a toml encoded string and return it as dict instance.
161+ # Try to load/decode a toml encoded data and return it as dict instance.
160162# Accept as first argument: url, filepath or string.
161163# A ValueError is raised in case of failure.
162164benedict.from_toml(s)
163165```
164166
167+ - ##### from_xml
168+
169+ ``` python
170+ # Try to load/decode a xml encoded data and return it as dict instance.
171+ # Accept as first argument: url, filepath or string.
172+ # A ValueError is raised in case of failure.
173+ benedict.from_xml(s)
174+ ```
175+
165176- ##### from_yaml
166177
167178``` python
168- # Try to load/decode a yaml encoded string and return it as dict instance.
179+ # Try to load/decode a yaml encoded data and return it as dict instance.
169180# Accept as first argument: url, filepath or string.
170181# A ValueError is raised in case of failure.
171182benedict.from_yaml(s)
@@ -189,6 +200,15 @@ s = d.to_json(filepath='', **kwargs)
189200s = d.to_toml(filepath = ' ' , ** kwargs)
190201```
191202
203+ - ##### to_xml
204+
205+ ``` python
206+ # Return the dict instance encoded in xml format and optionally save it at the specified filepath.
207+ # It's possible to pass custom options to the encoder using kwargs.
208+ # A ValueError is raised in case of failure.
209+ s = d.to_xml(filepath = ' ' , ** kwargs)
210+ ```
211+
192212- ##### to_yaml
193213
194214``` python
0 commit comments