File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -101,12 +101,20 @@ import tomllib
101
101
import datetime
102
102
from tomlval import TOMLValidator, TOMLSchema
103
103
104
- # Load data
104
+ # Load data from file
105
105
path = pathlib.Path(" data.toml" )
106
106
107
107
with path.open(" rb" ) as file :
108
108
data = tomllib.load(file )
109
109
110
+ # Use a dictionary
111
+ # data = {
112
+ # "first_name": "John",
113
+ # "last_name": "Doe",
114
+ # "age": 25,
115
+ # ...
116
+ # }
117
+
110
118
# Define schema (optional)
111
119
structure = {
112
120
" first_name" : str ,
Original file line number Diff line number Diff line change 1
1
[project ]
2
2
name = " tomlval"
3
- version = " 1.0.3 "
3
+ version = " 1.0.4 "
4
4
description = " A simple and easy to use TOML validator for Python."
5
5
authors = [
6
6
{
name =
" Marcus Fredriksson" ,
email =
" [email protected] " },
You can’t perform that action at this time.
0 commit comments