Use dataclasses without repeating yourself
Project description
docs |
|
---|---|
tests |
|
package |
Convert dataclasses into a command-line interface.
Quickstart
To install, use
pip install clout
Define some dataclasses and convert them into a command-line interface.
import attr
import click
import clout
@attr.dataclass
class DB:
host: str
port: int
@attr.dataclass
class Config:
db: DB
dry_run: bool
cli = clout.Command(type=Config)
print(cli.build())
$ myapp config --dry-run db --host example.com --port 9999
Config(db=DB(host='example.com', port=9999), dry_run=True)
See the full docs for more information: https://clout.readthedocs.io/
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
clout-0.1.7.post2.tar.gz
(16.2 kB
view hashes)
Built Distribution
Close
Hashes for clout-0.1.7.post2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e43a516e0a75217ae2e4a115c6778b9f91f253ebf04958446bf059e6a276641 |
|
MD5 | c7cb2189b9f2222e1f1a205c731492d8 |
|
BLAKE2b-256 | fd73bce9598b404ce9d641888fc621b339e47076884280861187e7b16ee1cab5 |