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.2.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.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: argflow-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 6f510f501567a0618063f155731dfafaab225d05f34778ea7fda6378f7657cef
MD5 0784bd4b5c774bd633b77359dfa5be7b
BLAKE2b-256 32006f11ecfb3b6b5b7c02cf618e49e17fd4a76d94fb876c7fe8d3cfee3cede8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: argflow-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0812ca8ff5d47fc660651c9729ad6c963c5c9035a4c3ceab079dd19ab6829bef
MD5 087774109890f376b23cfc454f446cf1
BLAKE2b-256 c33b2328370c6c8ea303da7a962a4e236d4ae175b8c2122fd302ebe57166e3b0

See more details on using hashes here.

Provenance

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