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.0.0.tar.gz (5.8 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.0.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for usage_spec-1.0.0.tar.gz
Algorithm Hash digest
SHA256 948bce7494faec595b9841959b464b7edab02f84d185e7bd3a93d7748fb1bf18
MD5 0102e900d3741bcd45a27623c4c92c49
BLAKE2b-256 883449bc7192f744f650d3aa7bafc22cc0f161e9306531825fb8d16ebe3527dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for usage_spec-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e5a58db7f7ba2ce2bda1ff4c10149c1c4a1ad05aa05e79d3b583e694ad13d38
MD5 b8f6be7dd57019d14107cd7fa670a439
BLAKE2b-256 bc9c17cf202b583c01b8ef16ab516b8433026d7770458f3e1a55f753131a1da3

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