Created
December 1, 2016 12:38
-
-
Save stepankuzmin/96455425ea438531692b0e64f0ea50cd to your computer and use it in GitHub Desktop.
Jupyter Notebook Python GIS Stack with host PostgreSQL support example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import psycopg2 | |
| conn = psycopg2.connect("dbname=db host=/var/run/postgresql/ user=user") | |
| cur = conn.cursor() | |
| cur.execute("select * from datasets.intervals;") | |
| cur.fetchone() | |
| cur.close() | |
| conn.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker run -d \ | |
| -p 8888:8888 \ | |
| -v "$(pwd)/notebooks:/home/jovyan/work" \ | |
| -v "/var/run/postgresql:/var/run/postgresql" \ | |
| --name gis-notebook \ | |
| urbica/gis-notebook start-notebook.sh --NotebookApp.allow_origin='*' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment