Skip to content

Instantly share code, notes, and snippets.

@stepankuzmin
Created December 1, 2016 12:38
Show Gist options
  • Save stepankuzmin/96455425ea438531692b0e64f0ea50cd to your computer and use it in GitHub Desktop.
Save stepankuzmin/96455425ea438531692b0e64f0ea50cd to your computer and use it in GitHub Desktop.
Jupyter Notebook Python GIS Stack with host PostgreSQL support example
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()
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