Swapping implementations from the command lineThe tool built over the last four posts asks the catalog the same questions again and again. summary alone is six requests, one per magnitude band plus one for the strongest event. Run it, change the Sep 16 · 20 min readmauvilsa.hashnode.dev
Settings from the environmentThe second post gave the tool a config file it finds on its own, so that ~/.config/quakes.yaml decides what quakes does from any directory. That solves the problem for a person with a home directory, Sep 2 · 13 min readmauvilsa.hashnode.dev
Tab completion, without writing a completion scriptThe first post derived a whole command line interface from a client class, and the second turned it into a command that runs from any directory. Both left the same gap in place: the tool knows a greatAug 20 · 15 min readmauvilsa.hashnode.dev
A CLI that works from anywhereThe previous post turned a client class into a command line tool with a single call to auto_cli. It ended with a file you run like this: python quakes_cli.py search --min_magnitude=5 That is fine whiAug 10 · 8 min readmauvilsa.hashnode.dev
From API client to CLI, without writing a parserAt some point most of us write a class that wraps an HTTP API. The constructor takes the things that do not change between calls: the base URL, the credentials, the timeout, a few defaults. The methodAug 3 · 18 min readmauvilsa.hashnode.dev