A list of all swiss postal addresses known according to a data set provided by the Swiss Post.
No warrenty for completeness and correctness! Use at your own risk.
- Download the file swiss-addresses.csv.gz
- Extract file with
gunzip swiss-addresses.csv.gz
. - Use as follows:
- Use the entire file with all the addresses.
- Grep for matches with e.g.
grep "AG;5420;" swiss-addresses.csv
- Extract a random sample with e.g.
shuf -n 20 swiss-addresses.csv
- Login to the Swiss Post Website (or create a new user account first).
- Download the current Address- und Geodaten. Make sure to get both the data as well as the current explanations (Strassenverzeichnis_mit_Sortierdaten_DE).
- Unzip the csv file, rename it to input.csv and copy it to this folder.
- Run
npm install
to make sure you have all necessary dependencies. - Delete the existing output file with
rm swiss-addresses.csv
. - Run the extraction with
node --max-old-space-size=4096 index.js
- Verify the output in
swiss-addresses.csv
. If the output seems to be incorrect, consult the guide Strassenverzeichnis_mit_Sortierdaten_DE and fix the extraction code accordingly :-).