Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Python TOML interface

TOML reader and writer.

Encoding

You can convert mappings to strings with to_string:

>>> toml.to_string({'table': {'a': 4, 'b': .1}})
'\n[table]\na = 4\nb = 0.1'

You can also write directly to files with to_path:

>>> toml.to_path('config.toml', {'table': {'a': 4, 'b': .1}})

Decoding

You can convert TOML to mappings with from_string:

>>> toml.from_string('[config]\ninteger = 2\nfloat = 3.1\nstring = "abc"')
{'config': {'integer': 2, 'float': 3.1, 'string': 'abc'}}

And you can read directly from a file path with from_path:

>>> toml.from_path('config.toml')

About

TOML to and from Python mappings

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages