cosima-cookbook icon indicating copy to clipboard operation
cosima-cookbook copied to clipboard

Command line tool for databases

Open aidanheerdegen opened this issue 5 years ago • 4 comments

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

aidanheerdegen avatar Jun 18 '19 23:06 aidanheerdegen

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.

jmunroe avatar Jun 18 '19 23:06 jmunroe

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.

aidanheerdegen avatar Jun 18 '19 23:06 aidanheerdegen

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.

jmunroe avatar Jun 19 '19 00:06 jmunroe

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.

aidanheerdegen avatar Jun 19 '19 00:06 aidanheerdegen