Simple yaml config file for argparse (command line arguments parsing)
Project description
Features
simple-argparse-config is a simple argparse config yaml files manager.
simple-argparse-config allows your python script to configure their argparse parser with a yaml file.
The name of the configuration file for the script /path/to/my/script.py is /path/to/my/script-argconfig.yaml
It can also convert your argparse parser configured by code, to yaml file configuration files. This is typically a one time operation to convert your scripts to the argparse yaml config file. After this operation, you can manage your command line arguments in the config file.
Install
pip install simple-argparse-config
or
uv add simple-argparse-config
Usage
import simple_argparse_config as sac
parser = sac.arg_parser_from_config_for_script(__file__)
# Tests, export argparse parser config to the config yaml file
# sac.arg_parser_to_config_for_script(parser , __file__)
# parser_clone = sac.arg_parser_from_config_for_script(__file__)
args = parser.parse_args()
The utility was first used as a way to share arguments info between the script itself, and a GUI made with streamlit, allowing to launch the script with customized arguments through the streamlit web app.
Limitations
This utiliy was built with the help of Gemini 3 LLM. Several iterations, and manual corrections.
Compatible with these argument types :
{'Path': Path, 'int': int, 'float': float, 'str': str}
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simple_argparse_config-0.1.0.tar.gz.
File metadata
- Download URL: simple_argparse_config-0.1.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62b65ecfa35e701a9537d629f38ff83ade31c84c50d914c226c4857f903f7235
|
|
| MD5 |
2d376e73d7c797407f431d6a92a14626
|
|
| BLAKE2b-256 |
a43323fb6b001fe9e625beedf222e179595e1babb168ba509718ad54fa6921d1
|
File details
Details for the file simple_argparse_config-0.1.0-py3-none-any.whl.
File metadata
- Download URL: simple_argparse_config-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20602fdd4f7c750466f91f73d30dd93060ce23baf15b6b4d53f2f3e1ee843ab3
|
|
| MD5 |
51f99d4faa17447ea695219ca01b7af0
|
|
| BLAKE2b-256 |
db3b37abd7c3d0412f06035d13bf2b64eb4173edc82fa507d53a7b976dbaa145
|