Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

Billy commands

jpmckinney edited this page Apr 19, 2013 · 4 revisions

Examples from OpenStates are given, but these commands work with any Billy deployment.

download-photos

You must set the following settings in your billy_settings.py:

  • AWS_KEY
  • AWS_SECRET
  • AWS_BUCKET
billy-util download-photos ak al ar ...

mongo-index

billy-util mongo-index --purge

If you create your own indexes, either omit --purge or remember to recreate your indexes.

elasticsearch-push

Not sure exactly what you need in terms of setting up ElasticSearch.

billy-util elasticsearch-push ak al ar ...

dumpcsv

You must set the following settings in your billy_settings.py if you use the --upload switch:

  • AWS_KEY
  • AWS_SECRET
  • AWS_BUCKET
billy-util dumpcsv --upload ak al ar ...

dumpjson

You must set the following settings in your billy_settings.py:

  • API_BASE_URL, e.g. http://openstates.org/api/v1/ for OpenStates
  • API_KEY an API key if your API is authenticated

You can also use the --apikey API_KEY option, but it will expose your API key in your shell's history.

Set the following settings if you use the --upload switch:

  • AWS_KEY
  • AWS_SECRET
  • AWS_BUCKET
billy-util dumpjson --novalidate --upload ak al ar ...
  • You can remove the --novalidate switch if you want to validate all API data.
  • You can set the --schema_dir SCHEMA_DIR option to validate against your own schema.

update-ext-ids

Updates a legislator's Influence Explorer ID. Not sure when you need to run this command.

update_leg_ids

Matches a bill's sponsors and a vote's voters to a legislator document. Not sure when you need to run this command.