Metadata-Version: 2.1
Name: argmagic
Version: 0.0.1
Summary: Parse environment variables and CLI arguments for a given function signature.
Home-page: https://github.com/xiamaz/argmagic
Author: Max Zhao
Author-email: alcasa.mz@gmail.com
License: UNKNOWN
Description: # Argmagic
        
        Automatically generate argparse based env-var/CLI-interface from a given function.
        
        Example:
        
        Given a function with a docstring and type hints.
        
        ```python
        def hello(name: str):
            '''
            Say hello to name.
        
            Args:
                name: Your name.
        
            Raises:
                Nothing.
        
            Returns:
                Nothing.
            '''
            print('Hello', name)
        ```
        
        Create a CLI interface:
        
        ```python
        argmagic(hello)
        ```
        
        Argmagic will call the function with all parameters filled from CLI arguments.
        
        ```sh
        $ ./hello.py -h
        usage: hello [-h] [--name NAME]
        
        Say hello to name.
        
        optional arguments:
          -h, --help   show this help message and exit
          --name NAME  Your name.
        ```
        
        Additionally all specified parameters can also be defined via environment
        variables.
        
        ```sh
        $ NAME=test hello.py
        Hello test
        ```
        
        These can then again be overriden by CLI arguments.
        
        ```sh
        $ NAME=test hello.py --name something
        Hello something
        ```
        
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
