1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
# Wilderness
[](https://pypi.org/project/wilderness)
[](https://github.com/GjjvdBurg/wilderness/actions)
[](https://pepy.tech/project/wilderness)
[](https://wilderness.readthedocs.io/en/latest/?badge=latest)
<p align="right"><i>In wildness is the salvation of the world.</i> —
Aldo Leopold</p>
Wilderness is a light wrapper around [argparse][argparse] for creating command
line applications with multiple subcommands, in the style of [Git][git].
Wilderness also makes it easy to generate man pages for your application.
Wilderness is heavily inspired by [Cleo][cleo] and
[argparse-manpage][argparse-manpage], but aims to stick as closely as possible
to [argparse][argparse] to avoid users having to learn a new API.
## Installation
Wilderness is available on PyPI:
```
$ pip install wilderness
```
## Usage
Building command line applications with Wilderness is straightforward, but it
does expect a certain structure of the application. You can create
applications with or without subcommands, as illustrated with the
[fakegit][fakegit] and [fakedf][fakedf] examples, respectively.
Creating wilderness applications consist of the following steps:
1. Subclassing the ``wilderness.Application`` class to hold the main
application.
2. Adding one or more ``wilderness.Command`` objects for each of the
subcommands, optionally organized into ``wilderness.Group``s.
3. Minor changes to ``setup.py`` to build the manpages.
## Examples
Here are some examples that use Wilderness to build command line applications:
| Repository | Description |
|------------|-------------|
| [fakegit][fakegit] | A multi-level command line application similar to Git |
| [fakedf][fakedf] | An application without subcommands similar to df |
| [CleverCSV][CleverCSV] | CleverCSV is a package for handling messy CSV files |
| [Veld][Veld] | Easy command line analytics |
> Add your example here by opening a pull request!
## Notes
License: See the LICENSE file.
Author: [Gertjan van den Burg][gertjan]
[argparse-manpage]: https://github.com/praiskup/argparse-manpage
[argparse]: https://docs.python.org/3/library/argparse.html
[cleo]: https://github.com/sdispater/cleo
[fakedf]: https://github.com/GjjvdBurg/wilderness/tree/master/examples/fakedf
[fakegit]: https://github.com/GjjvdBurg/wilderness/tree/master/examples/fakegit
[gertjan]: https://gertjanvandenburg.com
[git]: https://git-scm.com/
[CleverCSV]: https://github.com/alan-turing-institute/CleverCSV
[Veld]: https://github.com/GjjvdBurg/Veld/
|