Skip to main content

Parser for Structured Configuration Language (SCL)

Project description

SCL (Python) — usage guide

This is a usage-focused guide. For the full SCL specification, see the root README.
Full documentation: click

Installation

pip install structcfg-parser

Or in requirements.txt:

structcfg-parser==1.1.0

Import and quick start

import scl_parser

# From file
config = scl_parser.load("config.scl")

# From string
config = scl_parser.loads("count :: num { 42 }")

# To file
scl_parser.dump(config, "output.scl")

# To string
s = scl_parser.dumps(config)

Examples

import scl_parser

cfg = scl_parser.loads("""
app :: class {
  name :: str { "Demo" }
  debug :: bool { true }
  ports :: list(num) { 80, 443 }
  price :: fl { 19.99 }
  note :: ml {
    'hello
    world'
  }
}
""")
print(cfg["app"]["name"])

License

MIT License

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

structcfg_parser-1.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

structcfg_parser-1.1.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file structcfg_parser-1.1.0.tar.gz.

File metadata

  • Download URL: structcfg_parser-1.1.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for structcfg_parser-1.1.0.tar.gz
Algorithm Hash digest
SHA256 f74d3d447ee354742dbbc13a4b9d07ee03b219af31bc152cbb3a6857b3e8a8ad
MD5 e6028f6db9b98c3d062c74ebe078b656
BLAKE2b-256 e7c361a7a9b33c124f5fdd6517181c58285bf8ad1ec0642b259b0b9085896299

See more details on using hashes here.

File details

Details for the file structcfg_parser-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for structcfg_parser-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13ce3d2322729bdd2d606ccc9f13906942f268a9ed1d5fa3c3b4679a5feb6e99
MD5 c7ddb4bab3533e965f0ea8aa5f782113
BLAKE2b-256 7daa541f0352894e7028ca9865dcc1236369b59d91458bcc321de83ecc1569dd

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