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.1.0.tar.gz (5.9 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.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for usage_spec-1.1.0.tar.gz
Algorithm Hash digest
SHA256 6a27dc5b982c5e052e9cf3a93d6b852bd56130d8eae90db9523c7591971d6860
MD5 a53cf0f48aec575bb415bec35e911650
BLAKE2b-256 9598497b747be4e7a7cfabb033b347c98a2b01b20ae833398badbb3798ede93c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for usage_spec-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 950e362cc945b66670c55ac7dda03beee0ebc67ec1649bdb9f55077609d6c5de
MD5 8ab8526506f02130c61d6a157831822b
BLAKE2b-256 22053015974b953ce5bd7c739458af304269f56490c4298fdb1c4a98ce5f803f

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