Skip to main content

Argparge

A very simple tool to create beautiful console application by using native argparse.

Project Commander
Author Özcan Yarımdünya
Documentation https://ozcanyarimdunya.github.io/argparge/
Source code https://github.com/ozcanyarimdunya/argparge/

argparge is a library that you can create beautiful class based cli application.

Installation

Works on python3+ with no extra dependencies.

pip install argparge

Usage

example.py

from argparge import Application
from argparge import Command


class GreetCommand(Command):
    name = "greet"
    help = "Greeting a person"

    def add_arguments(self, parser: "Command"):
        parser.add_argument("name", help="Person name")

    def handle(self, **arguments):
        print("Greeting, ", arguments.get("name"))


if __name__ == '__main__':
    app = Application(description="A simple argparge application")
    app.add_argument("-V", "--version", action="version", version="1.0.0")
    app.add_commands(
        GreetCommand(),
    )
    app.run()

If we run we get such output.

gif

For more checkout tutorials.

LICENSE

MIT License

Copyright (c) 2023 yarimdunya.com

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.

Metadata

Release files for argparge 0.1.5

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

Source distribution (sdist)

Source distribution for argparge 0.1.5
File Size Uploaded
argparge-0.1.5.tar.gz 3.1 kB Details

Built distribution (wheel)

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

Total release size: 7.3 kB

Release files / argparge-0.1.5.tar.gz

Download URL argparge-0.1.5.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
daed0349730b7c74572e83ffd6c019c371ea286364997cf405b09204b25d7099
BLAKE2b-256 checksum
How to use checksums
6cb0b1a0d783bb67f2f49dc46103652b7fdc62cc0f72617e7066924303c96bbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.7.17 Linux/6.2.0-1015-azure

Release files / argparge-0.1.5-py3-none-any.whl

Download URL argparge-0.1.5-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4685919302f42ca35ab8a62fc114666505888dead2cf8189aafa14a81933b84
BLAKE2b-256 checksum
How to use checksums
a151481a7b75bd97fc170997122b4b71bce9eecc016351f310d91c2a30bc051e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.7.17 Linux/6.2.0-1015-azure

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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