Skip to content

Commit

Permalink
Add tomlkit.dump() example (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
sburris0 authored Jul 24, 2024
1 parent 60ed905 commit 2344a42
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tomlkit/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ def dump(data: Mapping, fp: IO[str], *, sort_keys: bool = False) -> None:
:param data: a dict-like object to dump
:param sort_keys: if true, sort the keys in alphabetic order
:Example:
>>> with open("output.toml", "w") as fp:
... tomlkit.dump(data, fp)
"""
fp.write(dumps(data, sort_keys=sort_keys))

Expand Down

0 comments on commit 2344a42

Please sign in to comment.