From 347d0caa2d5a66fc6a4ffa819f162940fa016dbb Mon Sep 17 00:00:00 2001 From: Spencer Burris Date: Tue, 23 Jul 2024 19:31:45 -0600 Subject: [PATCH] Add tomlkit.dump() example --- tomlkit/api.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tomlkit/api.py b/tomlkit/api.py index e2ea634..a7f6a61 100644 --- a/tomlkit/api.py +++ b/tomlkit/api.py @@ -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))