Skip to content

Commit 62a1496

Browse files
committed
readme edits
1 parent 8ce9f5a commit 62a1496

File tree

2 files changed

+36
-33
lines changed

2 files changed

+36
-33
lines changed

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,20 @@
1212
[![Test Status](https://github.com/bckohan/django-typer/workflows/test/badge.svg)](https://github.com/bckohan/django-typer/actions/workflows/test.yml)
1313
[![Lint Status](https://github.com/bckohan/django-typer/workflows/lint/badge.svg)](https://github.com/bckohan/django-typer/actions/workflows/lint.yml)
1414

15-
Use [Typer](https://typer.tiangolo.com/) to define the CLI for your [Django](https://www.djangoproject.com/) management commands using the typer interface. Optionally use the provided TyperCommand class that inherits from [BaseCommand](https://docs.djangoproject.com/en/stable/howto/custom-management-commands/#django.core.management.BaseCommand). This class maps the typer interface onto a class based interface that Django developers will be familiar with. All of the BaseCommand functionality is preserved, so that TyperCommand can be a drop in replacement.
15+
Use static typing to define the CLI for your [Django](https://www.djangoproject.com/) management commands with [Typer](https://typer.tiangolo.com/). Optionally use the provided [TyperCommand](https://django-typer.readthedocs.io/en/latest/reference.html#django_typer.TyperCommand) class that inherits from [BaseCommand](https://docs.djangoproject.com/en/stable/howto/custom-management-commands/#django.core.management.BaseCommand). This class maps the [Typer](https://typer.tiangolo.com/) interface onto a class based interface that Django developers will be familiar with. All of the [BaseCommand](https://docs.djangoproject.com/en/stable/howto/custom-management-commands/#django.core.management.BaseCommand) functionality is preserved, so that [TyperCommand](https://django-typer.readthedocs.io/en/latest/reference.html#django_typer.TyperCommand) can be a drop in replacement.
1616

1717
**django-typer makes it easy to:**
1818

19-
- Define your command CLI interface in a clear, DRY, and safe way using type hints.
20-
- Create subcommand and group command hierarchies.
21-
- Use the full power of Typer's parameter types to validate and parse command line inputs.
22-
- Create beautiful and information dense help outputs.
23-
- Configure the rendering of exception stack traces using rich.
24-
- [Install shell tab-completion support](https://django-typer.readthedocs.io/en/latest/shell_completion.html) for TyperCommands and normal Django commands for [bash](https://www.gnu.org/software/bash/), [zsh](https://www.zsh.org/), [fish](https://fishshell.com/), and [powershell](https://learn.microsoft.com/en-us/powershell/scripting/overview).
25-
- [Create custom and portable shell tab-completions for your CLI parameters.](https://django-typer.readthedocs.io/en/latest/shell_completion.html#defining-custom-completions)
26-
- Refactor existing management commands into TyperCommands because TyperCommand is interface compatible with BaseCommand.
27-
- Use either a class-based interface or the basic Typer style interface to define commands.
19+
* Define your command CLI interface in a clear, DRY and safe way using type hints
20+
* Create subcommands and hierarchical groups of commands.
21+
* Use the full power of [Typer](https://typer.tiangolo.com/)'s parameter types to validate and parse command line inputs.
22+
* Create beautiful and information dense help outputs.
23+
* Configure the rendering of exception stack traces using [rich](https://rich.readthedocs.io/en/latest/).
24+
* [Install shell tab-completion support](https://django-typer.readthedocs.io/en/latest/shell_completion.html) for [bash](https://www.gnu.org/software/bash/), [zsh](https://www.zsh.org/), [fish](https://fishshell.com/), and [powershell](https://learn.microsoft.com/en-us/powershell/scripting/overview).
25+
* [Create custom and portable shell tab-completions for your CLI parameters.](https://django-typer.readthedocs.io/en/latest/shell_completion.html#defining-custom-completions)
26+
* Port existing commands ([TyperCommand](https://django-typer.readthedocs.io/en/latest/reference.html#django_typer.TyperCommand) is interface compatible with [BaseCommand](https://docs.djangoproject.com/en/stable/howto/custom-management-commands/#django.core.management.BaseCommand)).
27+
* Use either a Django-style class-based interface or the Typer-style interface to define commands.
28+
* Add plugins to upstream commands.
2829

2930
Please refer to the [full documentation](https://django-typer.readthedocs.io/) for more information.
3031

@@ -44,7 +45,7 @@ Please refer to the [full documentation](https://django-typer.readthedocs.io/) f
4445
pip install "django-typer[rich]"
4546
```
4647

47-
2. Add `django_typer` to your `INSTALLED_APPS` setting:
48+
2. Optionally add `django_typer` to your `INSTALLED_APPS` setting:
4849

4950
```python
5051
INSTALLED_APPS = [
@@ -57,7 +58,7 @@ Please refer to the [full documentation](https://django-typer.readthedocs.io/) f
5758

5859
## Basic Example
5960

60-
For example, TyperCommands can be a very simple drop-in replacement for BaseCommands. All of the documented features of [BaseCommand](https://docs.djangoproject.com/en/stable/howto/custom-management-commands/#django.core.management.BaseCommand) work!
61+
[TyperCommand](https://django-typer.readthedocs.io/en/latest/reference.html#django_typer.TyperCommand) is a very simple drop in replacement for [BaseCommand](https://docs.djangoproject.com/en/stable/howto/custom-management-commands/#django.core.management.BaseCommand). All of the documented features of [BaseCommand](https://docs.djangoproject.com/en/stable/howto/custom-management-commands/#django.core.management.BaseCommand) work the same way!
6162

6263
```python
6364
from django_typer import TyperCommand
@@ -69,7 +70,7 @@ class Command(TyperCommand):
6970
"""
7071
```
7172

72-
Or, you may also use an interface identitical to Typer's. Just import typer from django_typer instead of typer:
73+
Or, you may also use an interface identical to [Typer](https://typer.tiangolo.com/)'s. Simply import [Typer](https://typer.tiangolo.com/) from django_typer instead of typer.
7374

7475
```python
7576
from django_typer import Typer
@@ -220,7 +221,7 @@ Using the class-based interface we could define the command like this:
220221

221222
```
222223

223-
The typer-style interface builds a TyperCommand class for us. **This allows you to optionally accept the self argument in your commands.** We could define the above command using the typer interface like this:
224+
The typer-style interface builds a [TyperCommand](https://django-typer.readthedocs.io/en/latest/reference.html#django_typer.TyperCommand) class for us **that allows you to optionally accept the self argument in your commands.** We could define the above command using the typer interface like this:
224225

225226
```python
226227

doc/source/index.rst

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,27 @@
55
Django Typer
66
============
77

8-
Use Typer_ to define the CLI for your Django_ management commands using Python's static typing.
9-
Optionally use the provided TyperCommand class that inherits from BaseCommand_. This class maps
10-
the typer interface onto a class based interface that Django developers will be familiar with.
11-
All of the BaseCommand functionality is preserved, so that TyperCommand can be a drop in
12-
replacement.
8+
Use static typing to define the CLI for your Django_ management commands with Typer_. Optionally
9+
use the provided :class:`~django_typer.TyperCommand` class that inherits from BaseCommand_. This
10+
class maps the Typer_ interface onto a class based interface that Django developers will be
11+
familiar with. All of the BaseCommand_ functionality is preserved, so that
12+
:class:`~django_typer.TyperCommand` can be a drop in replacement.
1313

1414
**django-typer makes it easy to:**
1515

1616
* Define your command CLI interface in a clear, DRY and safe way using type hints
17-
* Create subcommand and group command hierarchies.
18-
* Use the full power of Typer's parameter types to validate and parse command line inputs.
17+
* Create subcommands and hierarchical groups of commands.
18+
* Use the full power of Typer_'s parameter types to validate and parse command line inputs.
1919
* Create beautiful and information dense help outputs.
20-
* Configure the rendering of exception stack traces using rich.
21-
* :ref:`Install shell tab-completion support <shellcompletions>` for TyperCommands and normal
22-
Django_ commands for bash_, zsh_, fish_ and powershell_.
20+
* Configure the rendering of exception stack traces using rich_.
21+
* :ref:`Install shell tab-completion support <shellcompletions>` for bash_, zsh_, fish_ and
22+
powershell_.
2323
* :ref:`Create custom and portable shell tab-completions for your CLI parameters.
2424
<define-shellcompletions>`
25-
* Refactor existing management commands into TyperCommands because TyperCommand is interface
26-
compatible with BaseCommand.
27-
* Use either a class-based interface or the basic Typer style interface to define commands.
25+
* Port existing commands (:class:`~django_typer.TyperCommand` is interface compatible
26+
with BaseCommand_).
27+
* Use either a Django-style class-based interface or the Typer-style interface to define
28+
commands.
2829
* Add plugins to upstream commands.
2930

3031

@@ -44,7 +45,7 @@ replacement.
4445
pip install "django-typer[rich]"
4546
4647
47-
2. Add ``django_typer`` to your ``INSTALLED_APPS`` setting:
48+
2. Optionally add ``django_typer`` to your ``INSTALLED_APPS`` setting:
4849

4950
.. code:: python
5051
@@ -69,9 +70,9 @@ replacement.
6970

7071
:big:`Basic Example`
7172

72-
For example TyperCommands can be a very simple drop in replacement for BaseCommands. All of the
73-
documented features of BaseCommand_ work! Or, you may also use an interface identitical to Typer's.
74-
Simply import Typer from django_typer instead of typer.
73+
:class:`~django_typer.TyperCommand` is a very simple drop in replacement for BaseCommand_. All of
74+
the documented features of BaseCommand_ work the same way! Or, you may also use an interface
75+
identical to Typer_'s. Simply import Typer_ from django_typer instead of typer.
7576

7677
.. tabs::
7778

@@ -144,8 +145,9 @@ command like so:
144145
20.00
145146
146147
Any number of groups and subcommands and subgroups of other groups can be defined allowing for
147-
arbitrarily complex command hierarchies. The Typer-style interface builds a TyperCommand class for
148-
us **that allows you to optionally accept the self argument in your commands.**
148+
arbitrarily complex command hierarchies. The Typer-style interface builds a
149+
:class:`~django_typer.TyperCommand` class for us **that allows you to optionally accept the self
150+
argument in your commands.**
149151

150152
.. tabs::
151153

0 commit comments

Comments
 (0)