Development Data PartnershipΒΆ

A partnership between international organizations and companies, created to facilitate the use of third-party data in research and international development.

Part of the Development Data Partnership, docs is a Jupyter Book behind a Flask application that delegates authentication to GitHub OAuth.

In addition, it securely connects to a Bokeh application to serve interactive visualizations.

What’s insideΒΆ

β”œβ”€β”€ app                <- Flask application
β”œβ”€β”€ notebooks          <- Jupyter notebooks
β”œβ”€β”€ _config.yml        <- Jupyter Book configuration  
β”œβ”€β”€ _toc.yml           <- Jupyter Book table of contents
β”œβ”€β”€ Dockerfile         <- Dockerfile
└── Makefile           <- Makefile

RunΒΆ

Before you start, have the environment variables in hand to fill out the blanks.

  • BOKEH_SECRET_KEY (optional)

  • BOKEH_SERVER (optional)

  • FLASK_ENV

  • FLASK_SECRET

  • GITHUB_CLIENT_ID

  • GITHUB_CLIENT_SECRET

We recommend using python-dotenv. Simply rename env.example to .env and complete it with your environment variables.

With PythonΒΆ

Create your Python environment in your favorite fashion.

pip install -r requirements.txt

Build the Jupyter Book.

jupyter-book build .

Launch the development web server.

flask run

You can use make to take shortcuts.

With DockerΒΆ

docker build . -t datapartnership-docs:latest
docker run --rm \
    -e BOKEH_SECRET_KEY= \
    -e BOKEH_SERVER= \
    -e BOKEH_SIGN_SESSIONS=True \
    -e FLASK_ENV=development \
    -e GITHUB_CLIENT_ID= \
    -e GITHUB_CLIENT_SECRET= \
    -p 5000:5000 \
    datapartnership-docs

LicenseΒΆ

Β© Development Data Partnership