Command Line Interface

Warning

Please note that salamanca is still in early developmental stages, thus all interfaces are subject to change.

salamanca comes packaged with a CLI that can provide a number of easy-to-use interfaces for economic operations.

$ sal -h
usage: sal [-h] {download_wb,exchange,to_ppp,to_mer} ...

    Main CLI for salamanca.
    

positional arguments:
  {download_wb,exchange,to_ppp,to_mer}
    download_wb         Download national World Bank data to your machine
    exchange            Exchange currency from one country/year to another.
    to_ppp              Exchange currency in MER to PPP.
    to_mer              Exchange currency in PPP to MER.

optional arguments:
  -h, --help            show this help message and exit

Perform Currency Translation

$ sal exchange -h
usage: sal exchange [-h] [-x AMT] [-u UNITS] [-m METH] [-s] -f ISO YEAR -t ISO
                    YEAR

optional arguments:
  -h, --help            show this help message and exit
  -x AMT, --amt AMT     quantity of currency (default: 1.0)
  -u UNITS, --units UNITS
                        units in which to do conversion [MER or PPP] (default:
                        MER)
  -m METH, --meth METH  method to use to do conversion [deflator or cpi]
                        (default: deflator)
  -s, --inusd           if given, assume values are in USD instead of LC
                        (default: False)

required arguments:
  -f ISO YEAR, --from ISO YEAR
                        ISO: 3-letter ISO code for the origin country, YEAR:
                        origin year
  -t ISO YEAR, --to ISO YEAR
                        ISO: 3-letter ISO code for the destination country,
                        YEAR: destination year

Download Common World Bank Indicators

$ sal download_wb -h
usage: sal download_wb [-h] [--log] [--overwrite]

optional arguments:
  -h, --help   show this help message and exit
  --log        Print log output during download.
  --overwrite  Overwrite local files if they exist.