Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusfrdk committed Feb 4, 2025
1 parent 4bc0d82 commit 273fecf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,20 @@ import tomllib
import datetime
from tomlval import TOMLValidator, TOMLSchema

# Load data
# Load data from file
path = pathlib.Path("data.toml")

with path.open("rb") as file:
data = tomllib.load(file)

# Use a dictionary
# data = {
# "first_name": "John",
# "last_name": "Doe",
# "age": 25,
# ...
# }

# Define schema (optional)
structure = {
"first_name": str,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "tomlval"
version = "1.0.3"
version = "1.0.4"
description = "A simple and easy to use TOML validator for Python."
authors = [
{ name = "Marcus Fredriksson", email = "[email protected]" },
Expand Down

0 comments on commit 273fecf

Please sign in to comment.