3 ms·
Not sure if it's on par with Clap, but for Python I don't see enough people talk about SimpleParsing: https://github.com/lebrice/SimpleParsing https://github.co
by iloveyoudearly 1y ago
Not sure if it's on par with Clap, but for Python I don't see enough people talk about SimpleParsing: https://github.com/lebrice/SimpleParsing https://github.com/lebrice/SimpleParsing
It has quirks once you try to do something more complex/advanced, but for most of the simple stuff it's very nice to use.
- porridgeraisin 1y agoNice. I had made something similar (but less featureful), funnily enough also for an ML training script usecase. Here it is in a gist: https://gist.github.com/porridgewithraisins/313a26ee3b827f7338df78c72ccbb247 https://gist.github.com/porridgewithraisins/313a26ee3b827f73... I love the ergonomics of this method, and I was going to improve it to support subcommands, etc, but now I think I will use the library you posted.
- never_inline 1y agoPeople are used to the `click` way, where you can define args as function parameters. It's little more verbose but it helps click is a very established library which also provides many other things needed by CLI tools. There's also `typer` from the creator of `fastapi` which relies on type annotations. I have not had the opportunity to use it.
- woile 1y agoIn Python you can use pydantic to create a cli: https://docs.pydantic.dev/latest/concepts/pydantic_settings/#command-line-support https://docs.pydantic.dev/latest/concepts/pydantic_settings/...