Skip to main content

wcfg

wcfg is a small module to parse hierarchical data from text files, and it is particularly suitable for configuration files.

Features:

  • Text-based, hierarchical format, with simple syntax which is designed to be easy to parse both by programs and humans.

  • Both reading and writing back is supported. Written data is guaranteed to be readable back to its original representation.

  • Small, self-contained, pure Python implementation.

Grammar

This is the grammar accepted by the parser, in [EBNF syntax](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_Form):

identifier = - ( whitespace | “:” )

string character = - “"”

key-value pair = identifier, “:”, value
identifier, value

octal digit = “0” | “1” | “2” | “3” | “4” | “5” | “6” | “7”

digit = octal digit | “8” | “9”

hexdigit = digit | “a” | “b” | “c” | “d” | “e” | “f”
“A” | “B” | “C” | “D” | “E” | “F”

sign = “-” | “+”

integral number = digit, { digit }

dotted float = “.”, digit, { digit }
digit, “.”, { digit }
exponent = (“e” | “E”), sign, digit, { digit }
(“e” | “E”), digit, { digit }
float number = dotted float
dotted float, exponent
integral number, exponent
number body = integral number
float number
number = “0”, ( “x” | “X” ), hex digit, { hex digit }
“0”, octal digit, { octal digit }
sign, number body
number body
value = “"”, { string character }, “"”
“[”, { value } “]”
“{”, { key-value pair }, “}”
number
input = “{”, { key-value pair }, “}”
{ key-value pair }

Note that comments are not specified in the grammar above does not include comments for the sake of simplicity. Comments can appear anywhere except inside strings, and they span from the octothorpe sign (#) to the end of the line.

Metadata

Release files for wcfg 1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wcfg 1
File Size Uploaded Provenance
wcfg-1.tar.gz 2.6 kB Without provenance Details

Release files / wcfg-1.tar.gz

Download URL wcfg-1.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cc4dec0e879ae212c2a8a938a6fb3ad45cac82362a46e16823927d2164de3708
BLAKE2b-256 checksum
How to use checksums
383a5b3a6edae9a9f7f5d1a178bb2b9007437359c70f3f23ceaa810aee3995c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for wcfg 1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page