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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
948bce7494faec595b9841959b464b7edab02f84d185e7bd3a93d7748fb1bf18
|
|
| MD5 |
0102e900d3741bcd45a27623c4c92c49
|
|
| BLAKE2b-256 |
883449bc7192f744f650d3aa7bafc22cc0f161e9306531825fb8d16ebe3527dc
|
File details
Details for the file usage_spec-1.0.0-py3-none-any.whl.
File metadata
- Download URL: usage_spec-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e5a58db7f7ba2ce2bda1ff4c10149c1c4a1ad05aa05e79d3b583e694ad13d38
|
|
| MD5 |
b8f6be7dd57019d14107cd7fa670a439
|
|
| BLAKE2b-256 |
bc9c17cf202b583c01b8ef16ab516b8433026d7770458f3e1a55f753131a1da3
|