ap2json

2.0.1 • Public • Published

ap2json

Build Status

TODO explain how this only does primaries for now

Convert AP API results to many JSON files, one per state-party-racetype combination.

Usage: ap2json [options]

Options:
	-f, --file       File containing API election results. Must have a <races> field.  [string] [required]
	-d, --directory  Directory where ap2json will place the output JSON files.  [string] [required]
	-c, --clear      Whether to clear output directory before writing output files.  [boolean] [default: true]

	Examples:
		ap2json -f results.json -d output -c false

Real-world example

curl 'https://api.ap.org/v2/elections/2016-02-01?statepostal=IA&test=true&level=ru&apikey=<APTOKEN>&format=json' > ia.json
ap2json -f ia.json -d races

output

Install

npm install -g ap2json

Readme

Keywords

Package Sidebar

Install

npm i ap2json

Weekly Downloads

2

Version

2.0.1

License

MIT

Last publish

Collaborators

  • gabrielflorit