Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ideal-postcodes/postcodesiocsv
A quick command line script to translate a CSV of postcodes
https://github.com/ideal-postcodes/postcodesiocsv
Last synced: 10 days ago
JSON representation
A quick command line script to translate a CSV of postcodes
- Host: GitHub
- URL: https://github.com/ideal-postcodes/postcodesiocsv
- Owner: ideal-postcodes
- Created: 2017-01-05T10:20:47.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-04-30T08:40:07.000Z (over 3 years ago)
- Last Synced: 2024-04-09T22:26:33.405Z (7 months ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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 -g
```## Getting Started
```
postcodesiocsv -i -o
```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 -o -s postcode,country,northings,eastings
```You 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 -o -c 2
```## Example
input.csv
```
CA7 3AJ
HP10 9AW
INVALID POSTCODE
PL17 7BW
```Run with:
```
postcodesiocsv -i example.csv -o output.csv
```output.csv
```
CA7 3AJ,-3.32567403434222,54.7646808638358
HP10 9AW,-0.711040381510592,51.5989108287906
INVALID POSTCODE,,
PL17 7BW,-4.31379882001634,50.5040671479147
```## Changelog
1.0.3 Include flag to set postcode column
1.0.2 Initiate script from ./bin/
1.0.0 Initial commit