Skip to main content

A custom argument parsing library for CLI applications with a focus on simplicity and ease of use. ArgøNaut is designed to make it easy to create powerful and flexible command-line interfaces.

Project description

ArgøNaut: Advanced Argument Parsing Library

ArgøNaut Logo

GitHub stars GitHub issues License


📚 Table of Contents

  1. Introduction
  2. Features
  3. Installation
  4. Quick Start
  5. Advanced Usage
  6. Plugin System
  7. API Reference
  8. Examples
  9. Contributing
  10. License

🚀 Introduction

ArgøNaut is a sophisticated and flexible command-line argument parsing library for Python applications. It extends the capabilities of standard argument parsing libraries with advanced features, a robust plugin system, and cross-platform compatibility.


✨ Features

  • 🎨 Intuitive API for defining and parsing arguments
  • 🌳 Support for subcommands and nested command structures
  • 🔌 Robust plugin system for extensibility
  • 💻 Cross-platform compatibility (Windows, macOS, Linux)
  • 🛡️ Advanced input sanitization and error handling
  • 📚 Customizable help generation and formatting
  • 🐚 Shell completion script generation for multiple shells
  • 📊 Progress bar and colored output capabilities
  • 📁 Configuration file support (YAML, JSON)
  • 🌿 Environment variable integration
  • 📘 Automatic man page generation
  • ⚡ Asynchronous support for argument parsing and plugin execution

📦 Installation

Install ArgøNaut using pip:

pip install argonautCli

🚀 Quick Start

from argonaut import Argonaut


parser = Argonaut(description="My awesome CLI tool")
parser.add("--name", help="Your name")
parser.add("--age", type=int, help="Your age")
args = parser.parse()

print(f"Hello, {args['name']}! You are {args['age']} years old.")

🔧 Advanced Usage

Asynchronous Support

import asyncio
from argonaut import Argonaut


parser = Argonaut()
parser.add("--async-option", help="An async option")

async def main():
   args = await parser.parse_async()
   result = await parser.execute_plugin_async("my_plugin", args)
   
print(result)

Environment Variables

from argonaut import Argonaut


parser = Argonaut()
parser.add("--api-key", env_var="API_KEY", help="API key (can be set via API_KEY env var)")
args = parser.parse()

print(f"API Key: {args['api_key']}")

🔌 Plugin System

ArgøNaut features a powerful plugin system that allows you to extend the functionality of your CLI applications.

from argonaut import Plugin, PluginMetadata
import asyncio


class MyPlugin(Plugin):
   @property
   def metadata(self) -> PluginMetadata:
      return PluginMetadata(
      name="my_plugin",
      version="1.0.0",
      description="A sample plugin for ArgøNaut",
      author="Your Name",
      website="https://example.com",
      tags=["sample", "demo"]
      )

   def initialize(self, context):
      self.context = context
   def execute(self, args):
      return f"Hello from MyPlugin! Args: {args}"
   async def execute_async(self, args):
      # Asynchronous execution method
      return await some_async_operation(args)

def on_load(self):
print("Plugin loaded")

def on_unload(self):
print("Plugin unloaded")

def on_command_execution(self, command):
print(f"Command '{command}' is being executed")

📚 API Reference

For a complete API reference, please visit our documentation.


📋 Examples

For more examples, please refer to the examples directory in the repository.


🤝 Contributing

We welcome contributions to ArgøNaut! Please see our Contributing Guide for more details on how to get started.


📄 License

ArgøNaut is released under the MIT License. See the LICENSE file for full details.


For more information and detailed documentation, visit ArgøNaut's Documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

argonautcli-1.2.0.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

argonautCli-1.2.0-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

Details for the file argonautcli-1.2.0.tar.gz.

File metadata

  • Download URL: argonautcli-1.2.0.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for argonautcli-1.2.0.tar.gz
Algorithm Hash digest
SHA256 ed318a12ac5009b797dff433d3f6766f8d313f5c38dcf43ae85d04442cdab9e6
MD5 bbf85db1660a1c3512636b12dfac9182
BLAKE2b-256 265ed47965df92e5450fc0b7d1cec01ff552a001cd4c9b56bd141906d6eeff29

See more details on using hashes here.

Provenance

File details

Details for the file argonautCli-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: argonautCli-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for argonautCli-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49940afdfcecb427b71cd8779bf32f1d2a54f68b28f9605faca23e2c47ef1f73
MD5 5988a6b3b49f70f645d6826b3cca4fb1
BLAKE2b-256 837ad5f416ecf232d3a8e21d28780ee9281f00594b6b40a6f83e472b2302bb2a

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page