Skip to content

Commit 994e901

Browse files
tomgrin10sloria
andauthored
Add example for dict parser (#187)
* Add example for dict parser Blacken docs * Fix typo Co-authored-by: Steven Loria <sloria1@gmail.com>
1 parent ea3d879 commit 994e901

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export SHIP_DATE='1984-06-25'
5454
export TTL=42
5555
export ENABLE_LOGIN=true
5656
export GITHUB_REPOS=webargs,konch,ped
57+
export GITHUB_REPO_PRIORITY="webargs=2,konch=3"
5758
export COORDINATES=23.3,50.0
5859
export LOG_LEVEL=DEBUG
5960
```
@@ -82,6 +83,11 @@ enable_feature_x = env.bool("ENABLE_FEATURE_X", False) # => False
8283
# parsing lists
8384
gh_repos = env.list("GITHUB_REPOS") # => ['webargs', 'konch', 'ped']
8485
coords = env.list("COORDINATES", subcast=float) # => [23.3, 50.0]
86+
87+
# parsing dicts
88+
gh_repos_priorities = env.dict(
89+
"GITHUB_REPO_PRIORITY", subcast_values=int
90+
) # => {'webargs': 2, 'konch': 3}
8591
```
8692

8793
## Supported types

0 commit comments

Comments
 (0)