Script to amend aircraft database

The csv-to-json.py script in the dump1090 tools was useful only if creating a fresh database. But it can’t amend data to an already existing database. I modified the script to do so: https://github.com/jhalbsgut/hello-world/blob/master/importer.py.

To use this script, place it in the /db folder. Then create (or generate using some other means) a CSV file (locate in the same folder) with a header in a format similar to:


icao24,r,t,x,custom

Note that in the db, unless you modified planeObject.js, r is for Registration, t is for Type, and *desc *and *wtc *may also be defined already. But you can use whatever columns/fields you want to use if you integrate them into planeObject.js correctly.

After each csv file is imported, it is moved to the /archive folder. (Which you may have to create before running this script…I’m not totally sure.

Note that I removed the blocklimit part, which doesn’t have much of an effect unless you plan on adding hundreds of aircraft to the db that aren’t already there. If anyone’s interested, I’ll work on creating an update for that, or anyone else feel free to take on that challenge.

Any questions, please ask. I am an amateur at python and this is my first time uploading to github, so feedback is welcome.