Skip to main content

Core types and rendering for usage spec

Project description

usage-spec

Core types and rendering for usage spec.

Install

pip install usage-spec

API

Types

@dataclass
class Spec:
    name: str
    bin: str
    version: str
    about: str
    long: str
    usage: str
    flags: list[SpecFlag]
    args: list[SpecArg]
    cmds: list[SpecCommand]

Functions

from usage_spec import generate, render_kdl, render_json, validate_kdl

# Render Spec as KDL string
render_kdl(spec: Spec) -> str

# Render Spec as JSON string
render_json(spec: Spec) -> str

# Generate spec output with optional format and comment
generate(spec: Spec, format: str = "kdl", comment: str | None = None) -> str

# Validate KDL string by basic structural check
validate_kdl(kdl: str) -> None

License

MIT

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

usage_spec-1.2.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

usage_spec-1.2.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file usage_spec-1.2.0.tar.gz.

File metadata

  • Download URL: usage_spec-1.2.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.14

File hashes

Hashes for usage_spec-1.2.0.tar.gz
Algorithm Hash digest
SHA256 0cb27581d79e0c3299c956642957e724838dad3ba9faeb7164a5a1e6daf7b30a
MD5 ba6593672733e9172ac7a62c37656be4
BLAKE2b-256 c49803cee6cd613da11ef56b828bcb26d03d5e8abeba4ae16c897cbb91621f77

See more details on using hashes here.

File details

Details for the file usage_spec-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for usage_spec-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7df71345ce2de0547ff145b53d3a14f7336bb2728784beff1ea8f728f192a78c
MD5 b16cceeba19ecb866f7ccd5a505062d3
BLAKE2b-256 f7471a4c3f9093fb28e6d0586fb2f7502f02d1d77d0c80508ffb206542327668

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