swansonk14 / typed-argument-parser

Typed argument parser for Python
MIT License
505 stars 40 forks source link

[Feature Request] Add new config file types #137

Open pi314ever opened 6 months ago

pi314ever commented 6 months ago

Currently, the config file only supports CLI-style flags as inputs. Is it possible with the current design to have the config also accept other well-known config formats such as json, yaml, and toml?

martinjm97 commented 6 months ago

Hi @pi314ever,

Thank you for the good question! We currently only support CLI style files using the config=[...] syntax https://github.com/swansonk14/typed-argument-parser?tab=readme-ov-file#loading-from-configuration-files.

You can load from a JSON file via https://github.com/swansonk14/typed-argument-parser?tab=readme-ov-file#load.

We'd be happy to accept PRs either using the current JSON support to extend the config=[...] syntax or to add support for other commonly used formats (e.g., yaml and toml).

--JK