PHPackages                             zozlak/argparse - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. zozlak/argparse

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zozlak/argparse
===============

A humble PHP clone of Python's argparse library

1.0.4(1mo ago)15.3k↑772.7%6MITPHPPHP &gt;=8.1CI passing

Since Jan 9Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/zozlak/argparse)[ Packagist](https://packagist.org/packages/zozlak/argparse)[ Docs](https://github.com/zozlak/argparse)[ RSS](/packages/zozlak-argparse/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (6)Dependencies (4)Versions (7)Used By (6)

Argparse
========

[](#argparse)

[![Latest Stable Version](https://camo.githubusercontent.com/cf0ccb4873ff62d50b7a07274c29ad72bde2f78fadc6355501c28f47be915a81/68747470733a2f2f706f7365722e707567782e6f72672f7a6f7a6c616b2f61726770617273652f762f737461626c65)](https://packagist.org/packages/zozlak/argparse)[![Build Status](https://github.com/zozlak/argparse/actions/workflows/test.yml/badge.svg)](https://github.com/zozlak/argparse/actions/workflows/test.yml)[![Coverage Status](https://camo.githubusercontent.com/bbcec8ecfb80aba644acdb800a101479c67c81338efa419b806aec1216179407/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7a6f7a6c616b2f61726770617273652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/zozlak/argparse?branch=master)[![License](https://camo.githubusercontent.com/9e118df3775e3f011f89b1d7178fd1884451000fe5eb8d3474e2114dfa715f43/68747470733a2f2f706f7365722e707567782e6f72672f7a6f7a6c616b2f61726770617273652f6c6963656e7365)](https://packagist.org/packages/zozlak/argparse)

A humble PHP clone of Python's [argparse](https://docs.python.org/3/library/argparse.html).

Used to reduce my cognitive workload when switching between Python and PHP.

Implements only primary set of argparse features (see below) but strictly follows Python's argparse behavior.

API documentation
-----------------

[](#api-documentation)

See the [argparse docs](https://docs.python.org/3/library/argparse.html) with the following remarks:

- [ArgumentParser constructor](https://docs.python.org/3/library/argparse.html#argumentparser-objects)supports only `prog`, `description`, `epilog` and `exit-on-error` parameters.
    - [Argument abbreviations](https://docs.python.org/3/library/argparse.html#prefix-matching) are not implement.
- Almost all features of the [add\_argument()](https://docs.python.org/3/library/argparse.html#the-add-argument-method) method are implemented.
    Known discrepancies include:
    - If you want to define many names for a given argument, pass them as an array to the `name` parameter (it's impossible to implement it in PHP in exactly the same way it works in Python as PHP handles positional/named parameters in a slightly different way).
    - Lack of support for `%(prog)s` placeholder in the `help` parameter.
    - Lack of support for `metavar` parameter being an array.
- All features described under [other utilities](https://docs.python.org/3/library/argparse.html#other-utilities) **are not** implemented.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance93

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~318 days

Recently: every ~397 days

Total

6

Last Release

35d ago

Major Versions

0.1.0 → 1.0.02022-01-10

PHP version history (2 changes)0.1.0PHP &gt;=8.0

1.0.4PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/f1f662e3acb95efd9208cdcd2c97437db366044aea705985251760efcbd23070?d=identicon)[zozlak](/maintainers/zozlak)

---

Top Contributors

[![zozlak](https://avatars.githubusercontent.com/u/6503177?v=4)](https://github.com/zozlak "zozlak (18 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/zozlak-argparse/health.svg)

```
[![Health](https://phpackages.com/badges/zozlak-argparse/health.svg)](https://phpackages.com/packages/zozlak-argparse)
```

###  Alternatives

[lendable/clock

Clock Abstraction

17278.8k](/packages/lendable-clock)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

591.7k1](/packages/crumbls-layup)[alsatian/form-bundle

Symfony form types to extend built-in types. Ideal for Select2 AJAX implementations.

1424.6k](/packages/alsatian-form-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
