{"repo":"mpkocher/pydantic-cli","free":true,"listed":false,"github":"https://github.com/mpkocher/pydantic-cli","clone":"git clone https://github.com/mpkocher/pydantic-cli.git","description":"Turn Pydantic defined Data Models into CLI Tools","language":"Python","stars":161,"topics":["pydantic","python3","schemas","schema","cli","commandline-interface","argparse-alternative","argparse","commandline","config-management"],"license":"MIT","category":"cli-tools","readme_excerpt":"Pydantic Commandline Tool Interface Turn Pydantic defined Data Models into CLI Tools and enable loading values from JSON files Requires Pydantic =2.8.2 . Installation Features and Requirements 1. Thin Schema driven interfaces constructed from Pydantic defined data models 1. Validation is performed in a single location as defined by Pydantic's validation model and defined types 1. The CLI parsing level is only structurally validating the args or optional arguments/flags are provided 1. Enable loading config defined in JSON to override or set specific values (e.g. mytool -i in.csv --json-conf config.json ) 1. Clear interface between the CLI and your application code 1. Leverage the static analyzing tool mypy to catch type errors in your commandline tool 1. Easy to test (due to reasons defined above) 1. Color support for --help and for displaying errors (with Python = 3.14) Motivating Use cases - Quick scrapy commandline tools for local development (e.g., webscraper CLI tool, or CLI application that runs a training algo) - Internal tools driven by a Pydantic data model/schema - Configuration heavy tools that are driven by either partial (i.e, \"presets\") or complete configuration files defined using JSON Note: Newer version of pydantic-settings has support for commandline functionality. It allows mixing of \"sources\", such as ENV, YAML, JSON and might satisfy your requirements. https://docs.pydantic.dev/2.8/concepts/pydantic settings/#settings-management pydantic-cli predates the ","default_branch":null,"files":null,"tree":[],"storefront":"/r/mpkocher","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mpkocher/pydantic-cli/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}