python-toml
Port variant py37
Summary Tom's Obvious, Minimal Language (PY37)
Package version 0.10.2
Homepage https://github.com/uiri/toml
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants py38
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 01 NOV 2020, 17:15:16 UTC
Port created 09 APR 2020, 23:39:09 UTC
Subpackage Descriptions
single **** TOML **** A Python library for parsing and creating [TOML]. The module passes [the TOML test suite]. See also: * [The TOML Standard] * [The currently supported TOML specification] Installation ============ To install the latest release on [PyPI], simply run: :: pip install toml Or to install the latest development version, run: :: git clone https://github.com/uiri/toml.git cd toml python setup.py install Quick Tutorial ============== *toml.loads* takes in a string containing standard TOML-formatted data and returns a dictionary containing the parsed data. .. code:: pycon >>> import toml >>> toml_string = """ ... # This is a TOML document. ... ... title = "TOML Example" ... ... [owner] ... name = "Tom Preston-Werner" ... dob = 1979-05-27T07:32:00-08:00 # First class dates ... ... [database] ... server = "192.168.1.1" ... ports = [ 8001, 8001, 8002] ... connection_max = 5000 ... enabled = true ... ... [servers] ... ... # Indentation (tabs and/or spaces) is allowed but not required ... [servers.alpha] ... ip = "10.0.0.1" ... dc = "eqdc10" ... ... [servers.beta] ... ip = "10.0.0.2" ... dc = "eqdc10" ... ... [clients] ... data = [ ["gamma", "delta"], [1, 2]] ... ... # Line breaks are OK when inside arrays ... hosts = [ ... "alpha", ... "omega" ...] ... """ >>> parsed_toml = toml.loads(toml_string) *toml.dumps* takes a dictionary and returns a string containing the corresponding TOML-formatted data. .. code:: pycon >>> new_toml_string = toml.dumps(parsed_toml) >>> print(new_toml_string) title = "TOML Example" [owner] name = "Tom Preston-Werner" dob = 1979-05-27T07:32:00Z [database] server = "192.168.1.1" ports = [ 8001, 8001, 8002,] connection_max = 5000 enabled = true [clients] data = [ [ "gamma", "delta",], [ 1, 2,],] hosts = [ "alpha", "omega",] [servers.alpha] ip = "10.0.0.1" dc = "eqdc10" [servers.beta]
Configuration Switches (platform-specific settings discarded)
PY37 ON Build using Python 3.7 PY38 OFF Build using Python 3.8
Package Dependencies by Type
Build and Runtime python37:single:standard
python-setuptools:single:py37
Download groups
main mirror://PYPI/t/toml
Distribution File Information
b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f 22253 toml-0.10.2.tar.gz
Ports that require python-toml:py37
python-autopep8:py37 Automatic Python code formatter (PY37)
python-black:py37 Uncompromising code formatter (PY37)
python-sip:py37 Bindings generator for C/C++ libraries (PY37)
python-tqdm:py37 Fast, Extensible Progress Meter (PY37)
python-zipp:py37 Backport of pathlib wrapper for zip files (PY37)