No project description provided
Project description
Clipstick
A cli-tool based on Pydantic models.
There are many other tools out there, that do kind of the same, but they all didn't do quite exactly what I wanted.
Installation
pip install clipstick
Example
# examples/simple.py
from pydantic import BaseModel
from clipstick import parse
class SimpleModel(BaseModel):
"""A simple model demonstrating clipstick."""
name: str
"""Your name"""
repeat_count: int = 10
"""How many times to repeat your name."""
def main(self):
for _ in range(self.repeat_count):
print(f"hello: {self.name}")
if __name__ == "__main__":
model = parse(SimpleModel)
model.main()
running the above python examples/simple.py -h
gives you:
A simple model demonstrating clipstick.
positional args:
name : Your name
optional keyword arguments:
--repeat-count : How many times to repeat your name.
running the above python examples/simple.py alex --repeat-count 3
gives you:
hello: alex
hello: alex
hello: alex
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
clipstick-0.1.0.tar.gz
(5.0 kB
view hashes)
Built Distribution
Close
Hashes for clipstick-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63c490bb53c42bbefaecb0ed34ae38e1fbf57d3cadc93a08310bd6e3a5d6094f |
|
MD5 | 8f0e3df23440779267d91014f0f6641f |
|
BLAKE2b-256 | d2ca627dfc0e1662fc66b3688270b65266fc349288d004f3e36d6139fb13262f |