Metadata-Version: 2.4
Name: simple-argparse-config
Version: 0.1.0
Summary: Simple yaml config file for argparse (command line arguments parsing)
Project-URL: Homepage, https://github.com/jpsarda/simple-argparse-config
Author-email: JP Sarda <jpsarda@email.com>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Requires-Dist: pyyaml>=6.0.0
Provides-Extra: test
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: pytest>=7.0; extra == 'test'
Description-Content-Type: text/markdown

# 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}
```

