okfn-brasil / serenata-toolbox

📦 pip module containing code shared across Serenata de Amor's projects | ** Este repositório não recebe atualizações frequentes **
MIT License
154 stars 69 forks source link

Command line wrapper #201

Closed willianpaixao closed 5 years ago

willianpaixao commented 6 years ago

This is a POW for the CLI wrapper. Nothing fancy, it just calls the already existent classes, passing the arguments down the chain, then triggering the download.

I want to know if the choice for the executable serenata-toolbox and the parameters --dataset, --year are good choices. Let me know if you have a better suggestion.

If anyone wants to test, fetch my branch, follow the installation process in README.md in the Contributing section. After running python setup.py develop, you should have serenata-toolbox in your $PATH. Some examples:

# will download these datasets and store into export folder.
serenata-toolbox
# will download these datasets and store into export folder.
serenata-toolbox export --dataset federal-senate reimbursements
# you can specify a dataset and a year 
serenata-toolbox --dataset reimbursements --year 2009
# Or specify all options simultaneously 
serenata-toolbox export --dataset federal-senate --year 2017
# getting help
serenata-toolbox --help