Skip to main content

A very lite implementation of a toml parser, reader, and writer

Project description

psi-toml

A very lite implementation of a toml parser, reader, and writer

It is not a 1.0.0-compliant TOML library, nor is it intended to be.

It can parse basic toml files to a dict, and write a dict to a toml file using the load and dump methods.

Usage

from psi_toml import toml
    result = toml.load(f_toml)
    toml.dump(data, f_toml)
    toml.parse(strings)

where f_toml is the handle to the toml file, data is a python dict and strings is a list of strings representing key value pairs. E.g.

    strings = [
        'a = 1',
        'b = -1',
        'c = .5',
        'd = abc',
        'e = 3.14',
        'f = "1.414"',
        'g = true',
        'h = "false"',
        ]
    result = toml.parse(strings)

Installation

If you are using Poetry, add psi-toml to your pyproject.toml file by using:

poetry add psi-toml

If not, you can use pip:

pip install psi-toml

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

psi_toml-0.0.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

psi_toml-0.0.0-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file psi_toml-0.0.0.tar.gz.

File metadata

  • Download URL: psi_toml-0.0.0.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.12.7 Linux/6.6.65-1-MANJARO

File hashes

Hashes for psi_toml-0.0.0.tar.gz
Algorithm Hash digest
SHA256 ec1b31388992effdba19f497cc503dcf2058c9131cf248cf70933e8ada124863
MD5 d9e5d54626eea315cfcae95e7ebf2ce7
BLAKE2b-256 81677d380827dbf7f09d716ae8607b5e16f511c97edc09a9e74faca97ec90eaa

See more details on using hashes here.

File details

Details for the file psi_toml-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: psi_toml-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.12.7 Linux/6.6.65-1-MANJARO

File hashes

Hashes for psi_toml-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49a3acf2fec0b0fd8da4323f1f230871d8e3e8ff3f882e495d7490134ec5ee17
MD5 7ce644f8f33bcca592b13e0010535efd
BLAKE2b-256 c21a74e8812f4c8de7d86a41ef330bd4615884182596eb8a398a7eed305f9589

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page