finstem
typer
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.
finstem
-
Ask HN: Best thing you've made in CLI
It ain't much, but it's honest work: https://github.com/hiAndrewQuinn/finstem
I moved to Finland a few years ago to be with my then-fiancee, now-wife. I started learning Finnish and found that constantly going to Wiktionary to search for the root forms of their words, which have 15 declensions, possessive endings, clitics similar to Japanese particles, and other craziness going on in the root form themselves.
I wrote this to let me very quickly strip away all of that and get just the original dictionary forms of words. Later I wrapped it into a little `fzf` script to make it easy to analyze entire sentences or paragraphs at once.
The code is nothing special at all, but I use this thing dozens of times daily, and it's never let me down.
-
Command Line Interface Guidelines
I know it goes without saying for most of us here, but actually being a heavy terminal user yourself is one of the most important things to understand how to design CLIs. It helps a ton to understand the ecosystem you live in, not just your own organism.
Example: Something I did a few months back ago for a tiny personal project @ https://github.com/hiAndrewQuinn/finstem was implement `--format CSV`, `TSV` and `JSON` flags. I haven't had need for any of these myself, but they exist so any future people who want to use `csvkit`, `awk` and `jq` respectively to wrap around my program have easy ways to do so. That's not stuff I would have had the instincts to do if I wasn't myself a user of all 3 of those programs.
-
Cold-Blooded Software
Most of the software I write is at least somewhat cold-blooded by this definition. My program to find the dictionary forms of Finnish words is an okay example:
https://github.com/hiAndrewQuinn/finstem
I wrote the initial draft in an afternoon almost a year ago, and from then on endeavored to only make changes which I know play nicely with my local software ecology. I usually have `fzf` installed, so an interactive mode comes as a shell script. I usually have `csvkit`, `jq`, and if all else fails `awk` installed, so my last major update was to include flags for CSV, JSON, and TSV output respectively. Etc, etc.
The build instructions intentionally eschew anything like Poetry and just gives you the shell commands I would run on a fresh Ubuntu VirtualBox VM. I hand test it every couple of months in this environment. If the need to Dockerize it ever arose I'm sure it would be straightforward, in part because the shell commands themselves are straightforward.
-
PysimpleGUI
I'm considering taking a tool I have which has a pretty nicely fleshed-out CLI interface and wrapping a GUI around it, so people who don't run desktop Linux can use it too. This seems like it might be perfect for my needs.
https://github.com/hiAndrewQuinn/finstem
-
`finstem` can now do get you the root words for full sentences and paragraphs.
Big GitHub link
-
Things I've learned about building CLI tools in Python
I build little CLI tools in Python non-stop. ChatGPT and some basic knowledge of how the `click` library works has made it almost completely trivial to get the ball rolling for whatever need I have for it, `--help` text included.
The fact that the barrier for creation is so low means I'm even willing to do them to solve very niche problems in generalizable ways. [1] is common enough that a few people have starred it. [2] is niche enough that other Anki folks haven't used it AFAICT. [3] is likely something I'll never personally need again, even though Azure VM reservations not letting you customize your reminders for when they're about to expire is probably a costly mistake for a great many firms. All generated with this same starting methodology, because what I wanted was just a little too fiddly to want to hack together with my shell toolkit.
[1]: https://github.com/hiAndrewQuinn/finstem
[2]: https://github.com/hiAndrewQuinn/table2anki
[3]: https://github.com/hiAndrewQuinn/AzureReservations2ICS
typer
-
Github Sponsor Sebastián Ramírez Python programmer
He is probably most well know for creating FastAPI that I taught to some of my clients and Typer that I've never used.
- Typer: Python library for building CLI applications
- 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.
https://typer.tiangolo.com/
-
Things to do with standalone script
Adding CLI capabilities. My preferred library here is typer.
-
Where to start for managing a Python code base for public distribution
I just heard about this but it seems to be pretty much the type of thing you want and want fast.
-
Help on Docstrings
Docstrings are for documenting how a function/ class/ method/ module works. Often you don't need to add a docstring to your main function because no one will be importing it to use elsewhere. And if you want it to run as a CLI, then there are better ways to document the available options. For example, typer does most of it for you, or in click you add the help text to the decorator.
-
Which best practices do you follow to build robust & extensible ETL jobs?
Most computing tasks in airflow DAGs are KubernetesPodOperator containing a CLI (Python Typer). It allows us to pass arguments easily to run DAG manually if needed (the new UI to pass arguments to DAG in airflow 2.6 is really nice). Arguments allow us to replay DAG easily (change start / end dates for instance).
-
Devs on teams that deploy anytime you want, what does your SDLC workflow look like?
So it's basically the main .gitlab-ci.yml file plus a separate Python CI app using Typer for the AWS instrumentation.
-
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.
[1] https://typer.tiangolo.com/
What are some alternatives?
python_script_cc - A personal cookiecutter template for simple python3 scripts
click - Python composable command line interface toolkit
table2anki - HTML tables to Anki card packages. Does what it says on the tin!
Python Fire - Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.
poetry-cookiecutter - 🍪 Poetry Cookiecutter is a modern Cookiecutter template for scaffolding Python packages and apps
Gooey - Turn (almost) any Python command line program into a full GUI application with one line
AzureReservations2ICS - Given the CSV of the Azure Reservations website, create an ICS file of reminder events leading up to the expiration.
rich - Rich is a Python library for rich text and beautiful formatting in the terminal.
docopt - Create *beautiful* command-line interfaces with Python
python-prompt-toolkit - Library for building powerful interactive command line applications in Python
Nim - Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
cement - Application Framework for Python