cosima-cookbook
cosima-cookbook copied to clipboard
Command line tool for databases
It would be great to have a command line interface for generating/updating CC databases
Querying would be nice too! List all experiments, that sort of thing.
ping https://github.com/COSIMA/cosima-cookbook/pull/130
You mean like cosima-cookbook/scripts/build_index, but with, well, more?
I'll take a stab at writing the command line tool. Using python click should make it pretty straightforward.
Yes.
Be aware there are a lot of changes to the database build stuff that @angus-g has yet to merge. Probably best to wait until that is done.
Also, I'd avoid click, it relies quite strongly on utf-8
locales being set correctly IIRC.
Ok, I'll look at other CLI frameworks as well (there are lots of options out there)
Getting up to speed on those recent changes is a big part of why I'd like to write this tool.
Good point. We generally just use argparse
I'm not suggesting this is a-grade code but splitvar
has the layout I have sort of standardised on
https://github.com/coecms/splitvar/blob/master/splitvar/cli.py
which allows the cli interface to be programmatically tested.