Giter Site home page Giter Site logo

mevdschee / postcodes-nl Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 22 KB

Dutch postcodes in CSV format (7zip) and MySQL import script

License: MIT License

PHP 79.68% Shell 20.32%
csv-dataset dataset mysql nederland netherlands postcode postcodes

postcodes-nl's Introduction

Postcodes NL

Dutch postcodes in CSV format (7zip) and MySQL import script to allow for address validation in the Netherlands.

Check out the latest release.

Files

The release contains the following files:

  • postcodes-nl.7z: Dataset in CSV format with 7zip compression
  • postcodes-nl.php: Script to load the CSV into a MySQL database
  • postcodes-nl.sh: Script to unpack the 7zip archive and run PHP

NB: The CSV dataset is 341MB but with 7zip compression it is reduced to 15MB.

Running

Configure your database in postcodes-nl.php and run using:

bash postcodes-nl.sh

To run you need:

sudo apt install 7zip php-cli php-mysql

This assumes you are using a Debian based Linux distribution.

Releasing

Release using:

bash release.sh

To release you need:

sudo apt install 7zip wget php-cli gh

This uses the Github CLI on Debian Linux.

Sample data

Here are the first 3 records of the 24.04 release in CSV format:

straat,huisnummer,huisletter,huistoevoeging,woonplaats,postcode
"De Ruijterkade",99,,,Amsterdam,1011AB
"De Ruijterkade",105,,1,Amsterdam,1011AB
"De Ruijterkade",105,,2,Amsterdam,1011AB

Here is the SQL for those 3 records (including the table structure):

CREATE TABLE `postcodes` (
`straat` varchar(255) DEFAULT NULL,
`huisnummer` varchar(255) DEFAULT NULL,
`huisletter` varchar(255) DEFAULT NULL,
`huistoevoeging` varchar(255) DEFAULT NULL,
`woonplaats` varchar(255) DEFAULT NULL,
`postcode` varchar(255) DEFAULT NULL,
KEY `postcode` (`postcode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO `postcodes` (`straat`, `huisnummer`, `huisletter`, `huistoevoeging`, `woonplaats`, `postcode`) VALUES
('De Ruijterkade',	'99',	NULL,	NULL,	'Amsterdam',	'1011AB'),
('De Ruijterkade',	'105',	NULL,	'1',	'Amsterdam',	'1011AB'),
('De Ruijterkade',	'105',	NULL,	'2',	'Amsterdam',	'1011AB');

NB: The 24.04 release has 9771442 records.

Credits

This project loads the smallest dataset from:

Which is a fork of:

See also this blog post by Bert Hubert.

postcodes-nl's People

Contributors

mevdschee avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.