You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
python-benedict is a dict subclass with **keypath** support, **I/O** shortcuts (`Base64`, `JSON`, `TOML`, `XML`, `YAML`, `query-string`) and many **utilities**... for humans, obviously.
12
+
python-benedict is a dict subclass with **keypath** support, **I/O** shortcuts (`Base64`, `CSV`, `JSON`, `TOML`, `XML`, `YAML`, `query-string`) and many **utilities**... for humans, obviously.
13
13
14
14
## Index
15
15
-[Features](#features)
@@ -42,12 +42,14 @@ python-benedict is a dict subclass with **keypath** support, **I/O** shortcuts (
42
42
-[`unique`](#unique)
43
43
-[I/O](#io)
44
44
-[`from_base64`](#from_base64)
45
+
-[`from_csv`](#from_csv)
45
46
-[`from_json`](#from_json)
46
47
-[`from_query_string`](#from_query_string)
47
48
-[`from_toml`](#from_toml)
48
49
-[`from_xml`](#from_xml)
49
50
-[`from_yaml`](#from_yaml)
50
51
-[`to_base64`](#to_base64)
52
+
-[`to_csv`](#to_csv)
51
53
-[`to_json`](#to_json)
52
54
-[`to_query_string`](#to_query_string)
53
55
-[`to_toml`](#to_toml)
@@ -78,7 +80,7 @@ python-benedict is a dict subclass with **keypath** support, **I/O** shortcuts (
78
80
79
81
## Features
80
82
- Full **keypath** support using **keypath-separator***(dot syntax by default)* or **list of keys**.
81
-
- Easy **I/O operations** with most common formats: `Base64`, `JSON`, `TOML`, `XML`, `YAML`, `query-string`
83
+
- Easy **I/O operations** with most common formats: `Base64`, `CSV`, `JSON`, `TOML`, `XML`, `YAML`, `query-string`
82
84
- Many **utility** and **parse methods** to retrieve data as needed *(all methods listed below)*
83
85
- Well **tested**, check the badges ;)
84
86
- 100% **backward-compatible***(you can replace existing dicts without pain)*
@@ -333,30 +335,45 @@ d.unique()
333
335
334
336
### I/O
335
337
336
-
It is possible to create a `benedict` instance directly from data source (filepath, url or data-string) by passing the data source as first argument in the constructor.
338
+
It is possible to create a `benedict` instance directly from data source (filepath, url or data-string) by passing the data source and the data format (default 'json') in the constructor.
337
339
338
340
```python
339
341
# filepath
340
-
d = benedict('/root/data.yml')
342
+
d = benedict('/root/data.yml', format='yaml')
341
343
342
344
# url
343
-
d = benedict('https://localhost:8000/data.xml')
345
+
d = benedict('https://localhost:8000/data.xml', format='xml')
Copy file name to clipboardExpand all lines: benedict/metadata.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@
2
2
3
3
__author__='Fabio Caccamo'
4
4
__copyright__='Copyright (c) 2019 Fabio Caccamo'
5
-
__description__='python-benedict is a dict subclass with keypath support, I/O shortcuts (Base64, JSON, TOML, XML, YAML, query-string) and many utilities... for humans, obviously.'
5
+
__description__='python-benedict is a dict subclass with keypath support, I/O shortcuts (Base64, CSV, JSON, TOML, XML, YAML, query-string) and many utilities... for humans, obviously.'
0 commit comments