Metadata-Version: 2.4
Name: efficient-args
Version: 1.3.0
Summary: Helper Methods For argparse
Home-page: https://github.com/joemarchionna/efficient_args
Author: Joe Marchionna
Author-email: joemarchionna@gmail.com
License: Copyright (c) Joe Marchionna
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Keywords: ARGS
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Description-Content-Type: text/markdown
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: summary

# efficient-args - Helper Methods For argparse

Provides some simple methods for setting up scripts / apps in a multi-environment context.

## Usage

Installation:

````bash
    pip install efficient-args
````

This library was created to be used with scripts / apps that operate in multiple environments

````python
from efficient_args import FORMATTER, addBaseArgs, addListArgs, parseArgs, parseCmdLineList
import argparse

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Example Command Parser", formatter_class=FORMATTER)

    addBaseArgs(parser, addEnvironment=True)
    addListArgs(parser, required=True, itemName="Words")
    argDict = parseArgs(parser)

    words = parseCmdLineList(argDict)
    print(words)
````

Results in the output:

````bash
    user@pc MINGW64 /efficient_args
    23:50:45 (env) $ python examples/ex1.py -f tests/itemList.txt
    {'environment': 'test', 'list': [], 'file': 'tests/itemList.txt'}
    ['x33', 'x88', 'x44']
````

## Cloning For Development

Set up a virtual environment. Once an environment is set up, activate it and add dependencies with the following:

````bash
    pip install -r requirements/dev.txt
````

The dev.txt file includes:

* BLACK, a code formatter, see notes at the bottom of this file for details
* build, which provides the support for the building of the package

### To run tests:

````bash
    python -m unittest discover -s tests/
````

### Code Formatting

Code formatting is done using BLACK. BLACK allows almost no customization to how code is formatted with the exception of line length, which has been set to 119 characters.

Use the following to bulk format files:


````bash
    black . -l 144
````

### Creating A New Release

Please do the following when making a new release, most are documented above:

1. Run tests
1. Code format
1. Be sure to update the change log and _metadata.json with version and notes
1. git add, commit, and push changes
1. run the following code to generate a wheel:

````bash
    python -m build
````
