Skip to main content

The easier and "faster" alternative to argparse.

Project description

Argflow

Argflow is a fast, lightweight, and modular argument parser for Python. It is designed as a simpler alternative to argparse, ideal for small to medium CLI scripts.

Features

  • Minimal and easy-to-use API
  • Positional and optional arguments (key=value)
  • Multiple commands support (allow_multiple=True)
  • Modular callbacks for each argument
  • Extremely fast parsing (~200 lines of code)

Argflow vs Argparse

Note: argparse has more features, so its execution time is naturally higher.

Benchmark for a single argument:

Parser Parse Time
argparse 0.009876 s
argflow 0.000215 s
  • Argflow is ~98% faster than argparse for parsing.
  • Demonstrates how a compact library can create powerful and fast CLIs.

Reliability

  • Argflow is relatively new and still in active development.
  • Suitable for personal projects and experiments, but use with caution in critical production environments.

Example Usage

from argflow import argflow

af = argflow()

def hello(name):
    print(f"Hello, {name}!")

af.new_argument("--hello", hello)
af.parse()

Command line:

python script.py --hello Alice
# Output: Hello, Alice!

License

MIT License – free to use, modify, and distribute.

¿Quieres que haga eso?

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

argflow-1.0.3.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

argflow-1.0.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file argflow-1.0.3.tar.gz.

File metadata

  • Download URL: argflow-1.0.3.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for argflow-1.0.3.tar.gz
Algorithm Hash digest
SHA256 3f12b4d58f7d27be479f29ee30bf2ec99013d13457f679b84064bd6169ecddc2
MD5 64da5a75da5bfcbd170ec9970ed89324
BLAKE2b-256 88dbf489f739f3e35d8f4f5a59c5b8929b375b82c1df5243bd64ea96a57990fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for argflow-1.0.3.tar.gz:

Publisher: python-publish.yml on alesisce/argflow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file argflow-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: argflow-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for argflow-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 34bfdf230734f0d09b61faf7410b2e96ce7607bd500678b9e564a1d66403a3e0
MD5 025925d75627d581b779e99877379e3e
BLAKE2b-256 6d35b43b343fe39be61581537944d8d8bfe9a09bca2fa2cabba06636936f639f

See more details on using hashes here.

Provenance

The following attestation bundles were made for argflow-1.0.3-py3-none-any.whl:

Publisher: python-publish.yml on alesisce/argflow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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