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. zozlak/argparse

ActiveLibrary

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

A humble PHP clone of Python's argparse library

1.0.3(1y ago)14.7k↓86.7%6MITPHPPHP &gt;=8.0CI failing

Since Jan 9Pushed 2mo 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 1mo ago

READMEChangelog (5)Dependencies (2)Versions (6)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/workflows/phpunit/badge.svg?branch=master)](https://github.com/zozlak/argparse/workflows/phpunit/badge.svg?branch=master)[![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

43

—

FairBetter than 91% of packages

Maintenance65

Regular maintenance activity

Popularity24

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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 ~264 days

Total

5

Last Release

522d ago

Major Versions

0.1.0 → 1.0.02022-01-10

### 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 (16 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)
```

PHPackages © 2026

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