Skip to main content


Argila Parser
version 2.0.0


What is it?

It's a lightweight object oriented lib for Python 3.8+ to help create CLI programs more easily. It has an elegant design taking advantage of built-in modules, and delivering a conducive environment to fast development and readability.


Quickstart

This is the basic structure of your program, the class App represents the application, and the methods within it are the commands.

The typing module provides a built-in range of type hints, giving the developer a sophisticated way of accepting complex arguments. Any, Union, Tuple, List are currently supported.

import typing
from argila import Argila

@Argila.create
class App:
    @Argila.command(
        {
            'name': 'add',
            'positional': {
                'a': 'First element of the equation',
                'b': 'Second element of the equation'
            }
        }
    )
    def add(self, a: typing.Union[int, float], b: typing.Union[int, float]) -> None:
        '''This command adds two numbers together'''
        print(a + b)


if __name__ == '__main__':
    Argila.run()

A method is only considered a command if it has the @Argila.command decorator.
Below is the configuration dict in its completeness.

{
    'name': 'command',
    'positional': {
        'a': 'Obligatory argument'
    },
    'optional': {
        'b': 'Optional argument'
    },
    'keyword': {
        'c': 'Keyword argument'
    }
}

* means the key is obligatory.

name*: The name of the command used to call it. (This is the only nomination that matters, the method can have any name you'd like)

positional: A dict with all the positional arguments, the key should have the same name as the actual parameter in the method; the value is a short description of it. You invoke this argument with --key value.

optional: Same as positional, but optional arguments are not obligatory. You invoke this argument with --key value.

keyword: Same as positional, but keyword arguments are not obligatory and work as flags (bools). You invoke this argument with --key.

The order in which you invoke each argument does not matter, as long as you keep the syntax --key value. The examples add --a 1 --b 2 and add --b 2 --a 1 are both correct.


Apart from it, the docstring '''This command adds two numbers together''' is how you set the description of a command. If not set, the description defaults to an empty string.


Lastly, call Argila.run(), which is the method that will trigger all the subsequent others.

Metadata

Release files for argilaparser 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for argilaparser 2.0.1
File Size Uploaded Provenance
argilaparser-2.0.1.tar.gz 4.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for argilaparser 2.0.1
File Interpreter ABI Platform
argilaparser-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.8 kB

Release files / argilaparser-2.0.1.tar.gz

Download URL argilaparser-2.0.1.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3f7bb592fc20f913f43308563ce54ea1722e8ae05eab6101cbd60ded77f513df
BLAKE2b-256 checksum
How to use checksums
cf6a9e4e7d43f7f9004447e5867cc39536582656d0675bf41466d52567c99de3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release files / argilaparser-2.0.1-py3-none-any.whl

Download URL argilaparser-2.0.1-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27a5dcb475ebadfc29a0b97a33777aef351a58c82d65ad4132198764a9f1cd6a
BLAKE2b-256 checksum
How to use checksums
5afd00fd7d7782ba6ac0ba9c73ff020809f766fe65715fc3dd57bf0c146e2a35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Security for argilaparser 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page