Metadata-Version: 2.1
Name: argparse-utilities
Version: 0.0.2
Summary: Actions and other utility functions for use with argparse
Author-email: Scott Karlin <argparse-utilities@karlin-online.com>
Project-URL: Home Page, https://gitlab.com/sck/argparse-utilities
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: build
Requires-Dist: build ; extra == 'build'
Requires-Dist: twine ; extra == 'build'
Requires-Dist: packaging ; extra == 'build'
Provides-Extra: ci
Requires-Dist: pytest >=7.4 ; extra == 'ci'
Requires-Dist: twine ; extra == 'ci'
Requires-Dist: packaging ; extra == 'ci'
Requires-Dist: ruff ; extra == 'ci'
Provides-Extra: dev
Requires-Dist: build ; extra == 'dev'
Requires-Dist: twine ; extra == 'dev'
Requires-Dist: packaging ; extra == 'dev'
Requires-Dist: pre-commit >=3.4 ; extra == 'dev'
Requires-Dist: pytest >=7.4 ; extra == 'dev'
Requires-Dist: pytest-cov >=4.1 ; extra == 'dev'
Requires-Dist: coverage >=7.3 ; extra == 'dev'
Provides-Extra: tests
Requires-Dist: pytest >=7.4 ; extra == 'tests'

# argparse-utilities

*Actions and other utility functions for use with argparse*

## Quickstart

Install from pip:

```shell
pip install argparse-utilities
```

## Usage

```python
import argparse
from argparse_utilities import StoreMaxOneAction

parser = argparse.ArgumentParser(
    prog='Foo',
    description='foo foo foo',
)

parser.add_argument(
    '-f', '--foo',
    action=StoreMaxOneAction,
    type=int,
    required=True,
)

x = parser.parse_args(['--foo', '1'])
# x will be argparse.Namespace(foo=1)

parser.parse_args(['--foo', '1', '--foo', '2'])
# will throw ValueError('--foo supplied more than once')
```


## Development

For those developing or maintaining the `argparse-utilities` package itself,
be sure to install it with the `[dev]` option to pull in packages
used when developing.

    pip install --editable .[dev]

When developing, this package uses `pre-commit`.  After the initial
clone of the repository, you will need to set up pre-commit with:

    # in the top level of the checked-out repository:
    pre-commit install

## Changelog

### 0.0.2 released 2023-11-09
* Initial Version
