wsvincent / awesome-django

A curated list of awesome things related to Django
http://awesomedjango.org
Creative Commons Zero v1.0 Universal
9.5k stars 1.31k forks source link

Add django-typer #256

Closed bckohan closed 8 months ago

bckohan commented 8 months ago

Add django-typer app and include a link to click.


name: Add django-typer about: Suggest a new Django project for the Awesome Django list title: "[NEW] django-typer"

Project Information

  1. Project Name: django-typer

  2. Project URL: https://github.com/bckohan/django-typer

  3. Description:

Provides a TyperCommand class that extends from BaseCommand and allows devs to define their Django management commands using type hints via the Typer library. Includes a management command installer that adds shell tab completion support to both normal Django commands and TyperCommands for bash, zsh, fish and powershell.


Criteria

Please answer the following questions about the project you are submitting. This will help us evaluate if the project should be included in the Awesome Django list.

  1. Is the project new?

    • [x] Yes
    • [ ] No
  2. How long has the project been maintained? 4 months of active development and beta releases to get to production/stable.

  3. How many releases has it had if it's a library or package? 7 beta releases, 1 production/stable release: https://django-typer.readthedocs.io/en/latest/changelog.html

  4. Are you the author or are you submitting the project on behalf of a company?

    • [x] I am the author
    • [ ] I am submitting on behalf of a company
    • [ ] Other (please specify)
  5. What makes it awesome?

    • Brings Django CLI definition into the type hint forward future of Python interface design while maintaining total compliance with the old BaseCommand interface. All of the documented features of BaseCommand work!
    • Makes it easy to define shell tab completions for CLI parameters that pull from the database. Never have to copy/paste that UUID again!
    • Makes it straight forward to install tab completion support for all of Django on 4 popular shells.
    • Optional dependency on rich allows beautiful modern looking help outputs and stack traces.
    • Conversion both ways BaseCommand <-> TyperCommand is easy because of the interface compatibility.

Additional Information

Python has been changing under Django's feet and this has led to a lot of talk about Django being "long in the tooth". Fortunately Python also makes it easy to fit square pegs into round holes and I think this library is a good example of how you can seamlessly marry the new with the old to bring Django into the future without breaking the legacy code that a significant portion of our web runs on.

I realize the newness of this library might be a reason for caution. I've already incorporated it as a dependency into 3 professional projects and two personal ones I'm responsible for and that will have ongoing funding long into the future - so unless I get hit by the proverbial bus it will be supported. I've also integrated it with another Django package I've been maintaining for the last 3 years.

jefftriplett commented 8 months ago

@bckohan Thank you for submitting this to us. I saw this pass by on Mastodon, and I both starred it and queued it up for the newsletter this week. Very cool.

I realize the newness of this library might be a reason for caution.

This is 100% my concern, and it's nothing personal. I'd prefer to revisit it in a few months. I don't expect you to need dozens of releases or anything absurd, but more or less, we want to avoid adding something that becomes a one-off.

jefftriplett commented 8 months ago

I think "why does django-click not support typer?" is a good enough reason to merge this.

Thanks again for the contribution and for writing it.