Skip to content

Python script to import tables from a PostgreSQL/PostGIS SQL file to INTERLIS

License

Notifications You must be signed in to change notification settings

gacarrillor/pg2ili

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pg2ili

Python script to import tables and relationships from a PostgreSQL/PostGIS SQL (DDL) file to INTERLIS.

pg2ili

pg2ili was created for saving time when extracting (or reverse engineering) information about the structure of an existing physical model.

If you start from a PostgreSQL/PostGIS database and want to obtain an INTERLIS model from it, you can use pg2ili to get all your PG tables written as INTERLIS classes. Then you can open the obtained ili file in UML/INTERLIS Editor and adjust your model, i.e., adding meta-attributes, adjusting numeric ranges, among others.

Usage:

Go to pgAdmin v3 or v4 and create a (SQL) plain backup of your database schema. Now go to a terminal and run:

python3 ./pg2ili.py /docs/backup.sql My_New_Model My_New_Topic > /docs/my_model.ili

Examples:

See the tests/ folder for input and output examples.

Unit tests:

To run the unit tests, open the project in PyCharm, open tests.py file and press Ctrl + Shift + F10.

Individual tests can be run by typing this in a console (from repo folder):

python3 -m unittest tests.tests.TestPG2ILI.test_sql13    

About

Python script to import tables from a PostgreSQL/PostGIS SQL file to INTERLIS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages