Skip to main content

civis-jupyter-notebook

PyPI version CircleCI Builds

A tool to enable any Docker image to be used with Civis Platform Jupyter notebooks.

Usage

In your Dockerfile, put the following code at the end:

ENV DEFAULT_KERNEL=<your kernel>  # set to python3 or ir

RUN pip install civis-jupyter-notebook && \
    civis-jupyter-notebooks-install

# Add Tini
ENV TINI_VERSION=v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini

EXPOSE 8888
WORKDIR /root/work
ENTRYPOINT ["/tini", "--"]
CMD ["civis-jupyter-notebooks-start"]

Here you need to replace <your kernel> with the name of your kernel (e.g., python3 or ir). Note that your Dockerfile must use root as the default user.

See the example Docker image for more details.

Integration Testing Docker Images with Civis Platform

If you would like to test your image's integration with Civis Platform locally follow the steps below:

  1. Create a notebook in your Civis Platform account and grab the ID of the notebook. This ID is the number that appears at the end of the URL for the notebook, https://platform.civisanalytics.com/#/notebooks/<NOTEBOOK ID>.
  2. Create an environment file called my.env and add the following to it:
PLATFORM_OBJECT_ID=<NOTEBOOK ID>
CIVIS_API_KEY=<YOUR CIVIS API KEY>
  1. Build your image locally: docker build -t test ..
  2. Run the container: docker run --rm -p 8888:8888 --env-file my.env test.
  3. Access the notebook at the ip of your Docker host with port 8888 (e.g., http://localhost:8888/notebooks/notebook.ipynb).

Integration Testing Code Changes with Civis Platform

The scripts tests/build_dev_image.sh and tests/run_dev_image.sh can be used to test the integration of code changes with Civis Platform.

From the top directory in the repo type:

./tests/build_dev_image.sh
./tests/run_dev_image.sh <NOTEBOOK ID>

where <NOTEBOOK ID> is the ID of a Civis Platform notebook. See step 1 above if you do not have a notebook ID. Then you can connect to the notebook from your local browser and check to make sure it is working properly.

Contributing

See CONTRIBUTING.md for information about contributing to this project.

License

BSD-3

See LICENSE.txt for details.

The file terminal.js contains code from jupyter/nbclassic. As noted in the file, that code is Copyright (c) Jupyter Development Team and has a BSD-3 license.

Metadata

Release files for civis-jupyter-notebook 2.2.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 civis-jupyter-notebook 2.2.1
File Size Uploaded Provenance Actions
civis_jupyter_notebook-2.2.1.tar.gz 83.1 kB Without provenance Details for civis_jupyter_notebook-2.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for civis-jupyter-notebook 2.2.1
File Interpreter ABI Platform Actions
civis_jupyter_notebook-2.2.1-py3-none-any.whl Python 3 none any Details for civis_jupyter_notebook-2.2.1-py3-none-any.whl

Total release size: 167.9 kB

Release files / civis_jupyter_notebook-2.2.1.tar.gz

Download URL civis_jupyter_notebook-2.2.1.tar.gz
Size 83.1 kB
Tags Source
SHA-256 checksum
How to use checksums
abd49283dfe12aa3e79661c3c60740af60591235277d51078522dc6ddd839819
BLAKE2b-256 checksum
How to use checksums
754b737db8aac8b43c288a901e676ddd714d674bf5be35e251b379cd50f339fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.5

Release files / civis_jupyter_notebook-2.2.1-py3-none-any.whl

Download URL civis_jupyter_notebook-2.2.1-py3-none-any.whl
Size 84.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f46357fd7f9cb099d6e08ba4c502a1bf0e3acb6abe5cb5e706da2ff0043d2796
BLAKE2b-256 checksum
How to use checksums
82dbfc450693aeba8946af3e6c883c0bb3dbed8b1a7a67386f44f2536a447970
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.5

Security for civis-jupyter-notebook 2.2.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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