diff --git a/README.md b/README.md index 147a196..383d79f 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,15 @@ from the following sources: * [IS 50V Örnefni](https://opingogn.is/dataset/is-50v-ornefni-isn93) from the [National Land Survey of Iceland](https://www.lmi.is) (*Landmælingar Íslands*) * The postcode table provided by [Postur.is](https://www.postur.is/gogn/Gotuskra/postnumer.txt), with supplementary data from [Icelandic Wikipedia](https://is.wikipedia.org/wiki/Listi_yfir_%C3%ADslensk_p%C3%B3stn%C3%BAmer) +Since no networking takes place, lookups are fast and can be performed offline. The package is +useful for geocoding and reverse geocoding of Icelandic addresses and placenames, as well as for +validating addresses and postcodes. + ## Installation -`iceaddr` is available via [PyPI](https://pypi.org/project/iceaddr/). +The latest version of `iceaddr` is available via [PyPI](https://pypi.org/project/iceaddr/). -``` +```bash pip install iceaddr ``` @@ -237,6 +241,32 @@ placenames in the database: Landakotsvöllur ``` +## Build process + +To build your own version of the package, you need to have Python 3.7+ installed. +Then, after optionally creating a virtual environment, run the following command +from the repository root to install dependencies: + +```bash +pip install -r requirements.txt +``` + +Then, run the following command to build the database: + +```bash +$ python build_db.py +... +$ python add_placename_data.py +... +``` + +This creates an SQLite3 database in the repo root named `iceaddr.db`. Move this file to +`iceaddr/resources/` and you can now install your own version of the package: + +```bash +python setup.py install +``` + ## Version History * 0.5.5: Updated address and placename data. Removed ISN93 coords. Now requires Python 3.7+ (11/12/2022) diff --git a/TODO.txt b/TODO.txt index c6e10f4..889d817 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,6 +1,7 @@ TODO for iceaddr +* Provide placenames and street names in all cases (nf, þf, þgf, ef) * Verify that GPS coordinates are rational in DB build process * Better automation of geo data processing in db build scripts, should not be a separate step * iceaddr_suggest relies on comma separator to separate street address and place name. Could be made smarter. diff --git a/build_db.py b/build_db.py index 8187394..fc7dbbb 100755 --- a/build_db.py +++ b/build_db.py @@ -120,8 +120,8 @@ def insert_address_entry(e: Dict, conn: sqlite3.Connection) -> None: print(qargs) c = conn.cursor() c.execute("INSERT INTO stadfong VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)", qargs) - except Exception as e: - print(e) + except Exception as exc: + print(exc) def main() -> None: