postcodesiocsv
v1.0.4
Published
Quick script to parse CSV of postcodes and output associated information
Readme
Postocodes.io CSV Translation
A quick command line script to translate a CSV of postcodes (with postcodes in first column) into a list of results retrieved from the Postcodes.io API
Install
Since this is a command line script, you will need to install this globally
npm install postcodesiocsv -gGetting Started
postcodesiocsv -i <INPUT_FILE.csv> -o <OUTPUT_FILE.csv>This will return postcode,longitude,latitude by default. Specify your own output schema with the -s flag with properties separated by a comma
postcodesiocsv -i <INPUT_FILE.csv> -o <OUTPUT_FILE.csv> -s postcode,country,northings,eastingsYou can specify the column index for where your postcodes will be using the -c flag. Note, this is zero indexed, so -c 1 represents the second column
postcodesiocsv -i <INPUT_FILE.csv> -o <OUTPUT_FILE.csv> -c 2Example
input.csv
CA7 3AJ
HP10 9AW
INVALID POSTCODE
PL17 7BWRun with:
postcodesiocsv -i example.csv -o output.csvoutput.csv
CA7 3AJ,-3.32567403434222,54.7646808638358
HP10 9AW,-0.711040381510592,51.5989108287906
INVALID POSTCODE,,
PL17 7BW,-4.31379882001634,50.5040671479147Changelog
1.0.3 Include flag to set postcode column
1.0.2 Initiate script from ./bin/
1.0.0 Initial commit
