typer
click
Our great sponsors
typer | click | |
---|---|---|
86 | 32 | |
14,228 | 14,969 | |
- | 0.9% | |
6.7 | 8.0 | |
8 days ago | 10 days ago | |
Python | Python | |
MIT License | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
typer
- Copilot for your GitHub stars
-
Things I've learned about building CLI tools in Python
I have been using Typer on every one of my CLI projects which uses Click under the hood. The documentation is fantastic, the CLI app it produces looks great and lets you create things quickly. I high recommend it.
-
Things to do with standalone script
Adding CLI capabilities. My preferred library here is typer.
-
The different uses of Python type hints
Similarly for Typer, which is literally "the FastAPI of CLIs"[1]. Handy to type your `main` parameters and have CLI argument parsing. For more complicated cases, it's a wrapper around Click.
-
Command line parser library, which one do you like the most, regardless of language?
interesting that you hate python, but love Click. Did you try Typer which uses Click underneath?
-
I made a file manager in python
Try to make it into a command line tool? check https://typer.tiangolo.com/ for example
- How does "python3 *file* -*letter* work?
-
How to make a CLI?
I used this template repo to make a bash cli https://github.com/SierraSoftworks/bash-cli then I made a brew formula to make it installable. It provide a nice way to make a cli with nested commands like git. As others mentioned other languages like python have great support for making nice clis see https://typer.tiangolo.com/ for an example framework in python. I chose bash because packaging a python cli for a private brew package is a pain and 99% of what I needed the cli to do was inkoke other clis, so bash made sense for my case.
-
I am sick of writing argparse boilerplate code, so I made "duckargs" to do it for me
Very cool. I’ve been using Typer lately. Easy to give a library a cli without too much boilerplate.
-
Just released my much-improved YouTube archiver as v1.2 🎉🎉
Check out Typer for the command line tooling, might make it a bit easier to maintain later on!
click
-
click-web: Serve click scripts over the web (Python)
Context: "click" - "Command Line Interface Creation Kit" - easily create CLIs from Python code, via adding decorators: https://github.com/pallets/click
"click-web" in turn turns the click CLI app into a web app with one line of code.
- Anyone want to start a project with me.
-
How does "python3 *file* -*letter* work?
there is also click, it is more straight forward and also nice to keep the relevant code where the code is. https://github.com/pallets/click/
-
I am sick of writing argparse boilerplate code, so I made "duckargs" to do it for me
Hmm… did you try such approaches, as [click](https://github.com/pallets/click) or[tap](https://github.com/swansonk14/typed-argument-parser)?
-
lord-of-the-clips (lotc): CLI app to download, trim/clip, and merge videos. Supports lots of sites. Downloads/trims at multiple points. Merges multiple clips.
This app leverages these powerful libraries: - yt-dlp: video downloader - moviepy: video trimmer/merger - click: CLI app creator - rich / rich-click: CLI app styler
-
Shells Are Two Things
I've used click [1] a lot to build Python tooling scripts the past few years. Click usage is "sort of" similar to the author's proposed solution. There's also a small section here [2] that describes some of the issues covered in the article (in context of argparse).
The proposed solution of an API with a thinly wrapped auto-generated CLI is not terrible. I have heard it is common within Google, for example.
In the Python world, there are various solutions starting from https://github.com/ialbert/plac or https://argh.readthedocs.io/en/latest/ and moving on to https://github.com/pallets/click or https://github.com/Lucretiel/autocommand and probably N others.
Personally, I prefer Nim to Python which has https://github.com/c-blake/cligen. As mentioned in https://github.com/c-blake/cligen/blob/master/MOTIVATION.md, but not in the article, the overhead of dispatch to a program in shell REPLs can also be thousands to millions of times higher than an API call.
-
Whats the easiest way to configure argument parsing in bash
Personally, I don't. By the time a program needs command line arguments, I've usually moved to a more full-featured language, like Python. (FWIW, I like Click for argument parsing in Python.)
-
What’s the most convenient way for a non-programmer to run a Python code?
You could maybe make it a click Application, and use setuptools.
-
How to get started with Github contributions to python projects
It really depends what you're into. I love click, and poetry. But I'm not strong enough to contribute at the level those two require. I just post in the issues when I know an answer or have the information behind something people may be confused on. I've reported a bug or two to Poetry, Good luck.
What are some alternatives?
Python Fire - Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.
python-prompt-toolkit - Library for building powerful interactive command line applications in Python
cement - Application Framework for Python
cliff - Command Line Interface Formulation Framework. Mirror of code maintained at opendev.org.
docopt - This project is no longer maintained. Please see https://github.com/jazzband/docopt-ng
clint - Python Command-line Application Tools
Argh - An argparse wrapper that doesn't make you say "argh" each time you deal with it.
Gooey - Turn (almost) any Python command line program into a full GUI application with one line
plumbum - Plumbum: Shell Combinators
rich - Rich is a Python library for rich text and beautiful formatting in the terminal.