Skip to main content

Jupyter Quant

A dockerized Jupyter quant research environment.

Highlights

  • It can be used as a docker image or pypi package.
  • Includes tools for quant analysis, statsmodels, pymc, arch, py_vollib, zipline-reloaded, PyPortfolioOpt, etc.
  • The usual suspects are included, numpy, pandas, sci-py, scikit-learn, yellowbricks, shap, optuna.
  • ib_async for Interactive Broker connectivity. Works well with IB Gateway docker image.
  • Includes all major Python packages for statistical and time series analysis, see requirements. For an extensive list check list installed packages section.
  • Zipline-reloaded, pyfolio-reloaded and alphalens-reloaded.
  • You can install it as a python package, just pip install -U jupyter-quant
  • Designed for ephemeral containers. Relevant data for your environment will survive your container.
  • Optimized for size, it's a 2GB image vs 4GB for jupyter/scipy-notebook
  • Includes jedi language server, jupyterlab-lsp, black and isort.
  • It does NOT include conda/mamba. All packages are installed with pip under ~/.local/lib/python. Which should be mounted in a dedicated volume to preserve your environment.
  • Includes Cython, Numba, bottleneck and numexpr to speed up things
  • sudo, so you can install new packages if needed.
  • bash and stow, so you can BYODF (bring your dotfiles). Plus common command line utilities like git, less, nano (tiny), jq, ssh, curl, bash completion and others.
  • Support for apt cache. If you have other Linux boxes using it can leverage your package cache.
  • It does not include a built environment. If you need to install a package that does not provide wheels you can build your wheels, as explained in common tasks

Quick Start

To use jupyter-quant as a pypi package see install quant package.

Create a docker-compose.yml file with this content

services:
  jupyter-quant:
    image: gnzsnz/jupyter-quant:${IMAGE_VERSION}
    environment:
      APT_PROXY: ${APT_PROXY:-}
      BYODF: ${BYODF:-}
      SSH_KEYDIR: ${SSH_KEYDIR:-}
      START_SCRIPTS: ${START_SCRIPTS:-}
      TZ: ${QUANT_TZ:-}
    restart: unless-stopped
    ports:
      - ${LISTEN_PORT}:8888
    volumes:
      - quant_conf:/home/gordon/.config
      - quant_data:/home/gordon/.local
      - ${PWD}/Notebooks:/home/gordon/Notebooks

volumes:
  quant_conf:
  quant_data:

You can use .env-dist as your starting point.

cp .env-dist .env
# verify everything looks good
docker compose config
docker compose up

Volumes

The image is designed to work with 3 volumes:

  1. quant_data - volume for ~/.local folder. It contains caches and all Python packages. This enables to install additional packages through pip.
  2. quant_conf - volume for ~/.config, all config goes here. This includes jupyter, ipython, matplotlib, etc
  3. Bind mount (but you could use a named volume) - volume for all notebooks, under ~/Notebooks.

This allows to have ephemeral containers and to keep your notebooks (3), your config (2) and your additional packages (1). Eventually, you would need to update the image, in this case, your notebooks (3) can move without issues, your config (2) should still work but no warranty and your packages in quant_data could still be used but you should refresh it with a new image. Eventually, you would need to refresh (1) and less frequently (2)

Common tasks

Get running server URL

docker exec -it jupyterquant jupyter-server list
Currently running servers:
http://40798f7a604a:8888/?token=
ebf9e870d2aa0ed877590eb83b4d3bbbdfbd55467422a167 :: /home/gordon/Notebooks

or

docker logs -t jupyter-quant 2>&1 | grep '127.0.0.1:8888/lab?token='

You will need to change hostname (40798f7a604a in this case) or 127.0.0.1 by your docker host ip.

Show jupyter config

docker exec -it jupyter-quant jupyter-server --show-config

Set password

docker exec -it jupyter-quant jupyter-server password

Get command line help

docker exec -it jupyter-quant jupyter-server --help
docker exec -it jupyter-quant jupyter-lab --help

List installed packages

docker exec -it jupyter-quant pip list
# outdated packages
docker exec -it jupyter-quant pip list -o

Pass parameters to jupyter-lab

docker run -it --rm gnzsnz/jupyter-quant --core-mode
docker run -it --rm gnzsnz/jupyter-quant --show-config-json

Run a command in the container

docker run -it --rm gnzsnz/jupyter-quant bash

Build wheels outside the container

Build wheels outside the container and import wheels into the container

# make sure python version match .env-dist
docker run -it --rm -v $PWD/wheels:/wheels python:3.12 bash
pip wheel --no-cache-dir --wheel-dir /wheels numpy

This will build wheels for numpy (or any other package that you need) and save the file in $PWD/wheels. Then you can copy the wheels in your notebook mount (3 above) and install it within the container. You can even drag and drop into Jupyter.

Install your dotfiles

git clone your dotfiles to Notebook/etc/dotfiles, set environment variable BYODF=/home/gordon/Notebook/etc/dotfiles in your docker-compose.yml When the container starts up stow will create links like /home/gordon/.bashrc

Install your SSH keys

You need to define environment variable SSH_KEY_DIR which should point to a location with your keys. The suggested place is SSH_KEYDIR=/home/gordon/Notebooks/etc/ssh, make sure the director has the right permissions. Something like chmod 700 Notebooks/etc/ssh should work.

The entrypoint.sh script will create a symbolic link pointing to $SSH_KEYDIR on /home/gordon/.ssh.

Within Jupyter's terminal, you can then:

# start agent
eval $(ssh-agent)
# add keys to agent
ssh-add
# open a tunnel
ssh -fNL 4001:localhost:4001 gordon@bastion-ssh

Run scripts at start up

If you define START_SCRIPTS env variable with a path, all scripts on that directory will be executed at start up. The sample .env-dist file contains a commented line with START_SCRIPTS=/home/gordon/Notebooks/etc/start_scripts as an example and recommended location.

Files should have a .sh suffix and should run under bash. in directory start_scripts you will find example scripts to load ssh keys and install python packages.

Install jupyter-quant package

Jupyter-quant is available as a package in pypi. It's a meta-package that pulls all dependencies in it's highest possible version.

Install pypi package.

pip install -U jupyter-quant

Additional options supported are

pip install -U jupyter-quant[bayes] # to install pymc & arviz/graphviz

pip install -U jupyter-quant[sk-util] # to install skfolio & sktime

jupyter-quant it's a meta-package that pins all it's dependencies versions. If you need/want to upgrade a dependency you can uninstall jupyter-quant, although this can break interdependencies. Or install from git, where it's updated regularly.

# git install
pip install -U git+https://github.com/quantbelt/jupyter-quant.git

Metadata

Release files for jupyter-quant 2611.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jupyter-quant 2611.1
File Size Uploaded Provenance Actions
jupyter_quant-2611.1.tar.gz 14.2 kB With provenance Details for jupyter_quant-2611.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jupyter-quant 2611.1
File Interpreter ABI Platform Actions
jupyter_quant-2611.1-py3-none-any.whl Python 3 none any Details for jupyter_quant-2611.1-py3-none-any.whl

Total release size: 23.8 kB

Release files / jupyter_quant-2611.1.tar.gz

Download URL jupyter_quant-2611.1.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4642718c59fdf671cf4f8884d8dcb146b37f773409444232747af93aa6a059cb
BLAKE2b-256 checksum
How to use checksums
11e156357e28ae0a98b3aff03959f8352170f259a44706dbb33aef380d6c3489
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / jupyter_quant-2611.1-py3-none-any.whl

Download URL jupyter_quant-2611.1-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b265f412c54a6515e18da65c2c7a61084387f80c9600f33fb067083e8f575800
BLAKE2b-256 checksum
How to use checksums
080be0c3be8162ae72b3b65b59db5e357f7de884e387401470d1e2050f94891e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for jupyter-quant 2611.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for jupyter_quant-2611.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page