Documentation
¶
Overview ¶
Package toml provides the toml extension library.
Index ¶
Constants ¶
View Source
const LibraryName = "toml"
LibraryName is the script-visible name of the toml library.
Variables ¶
View Source
var Library = object.NewLibrary(LibraryName, map[string]*object.Builtin{ "loads": { Fn: tomlLoadsFunc, HelpText: `loads(toml_string) - Parse TOML string Parses a TOML string and returns the corresponding Scriptling object. This function is compatible with Python's tomllib.loads() from Python 3.11+. Example: import toml data = toml.loads("[database]\nhost = \"localhost\"\nport = 5432") print(data["database"]["host"])`, }, "dumps": { Fn: tomlDumpsFunc, HelpText: `dumps(obj) - Convert Scriptling object to TOML string Converts a Scriptling object to a TOML formatted string. Note: Python's tomllib does not include a write function. This follows the convention of the tomli-w library which provides dumps(). Example: import toml data = {"database": {"host": "localhost", "port": 5432}} toml_str = toml.dumps(data) print(toml_str)`, }, }, nil, "TOML parsing and generation")
Library provides TOML parsing and generation functionality
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.