aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2020-01-19 14:40:13 -0600
committerEugene Triguba <eugenetriguba@gmail.com>2020-01-19 14:40:13 -0600
commit9c8c6c1fc2ccf31bc8c709ab052c34a45e207b36 (patch)
tree54dcc521d4390880b89166deffbd5709d97b1e44 /README.md
parentAdd section on using your own parser (diff)
downloadconfig-file-9c8c6c1fc2ccf31bc8c709ab052c34a45e207b36.zip
Add support for retrieving entire sections with get()
Diffstat (limited to 'README.md')
-rw-r--r--README.md12
1 files changed, 6 insertions, 6 deletions
diff --git a/README.md b/README.md
index bb76e0f..708ad83 100644
--- a/README.md
+++ b/README.md
@@ -46,19 +46,19 @@ config.stringify()
>>> '[calendar]\ntoday = monday\nstart_week_on_sunday = false\ntoday_index = 0\nquarter_hours_passed = 0.25\n\n'
```
-### Retrieve values
+### Retrieve values or sections
A section.key format is used for retrieving and setting values.
```python
-config.get("calendar.today")
->>> 'monday'
-
# Values from the config file are automatically parsed
config.get("calendar.start_week_on_sunday")
>>> False
# Unless you don't want them to be parsed
-config.get("calendar.today_index", parse_type=False)
->>> '0'
+config.get("calendar.start_week_on_sunday", parse_type=False)
+>>> 'false'
+
+config.get("calendar")
+>>> {'today': 'monday', 'start_week_on_sunday': False, 'today_index': 0, 'quarter_hours_passed': 0.25}
```
### Set values