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.

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.4.tar.gz (4.3 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.4-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: argflow-1.0.4.tar.gz
  • Upload date:
  • Size: 4.3 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.4.tar.gz
Algorithm Hash digest
SHA256 21aa8003fd87b8737aa7a3ff119d3fa452882dce9c4fda22066da6de43fdaed8
MD5 6e50ca7fdc57d56704e1812c73266a0d
BLAKE2b-256 20d631af908d126e203612406971fe1f46aa6c46e4000aaecf791960f09e3754

See more details on using hashes here.

Provenance

The following attestation bundles were made for argflow-1.0.4.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.4-py3-none-any.whl.

File metadata

  • Download URL: argflow-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.9 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3af3b4e320614bf636abd8a942aa72ba42798b42397a7a60d0426b8fcc923fd5
MD5 0496c1a52c1fdb4fc6f3c95fe54a21cb
BLAKE2b-256 95e4491bee6b555dd40bbe02addb3892845a2f5d6e23f1408894c01116604321

See more details on using hashes here.

Provenance

The following attestation bundles were made for argflow-1.0.4-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