Skip to main content

papermill-tenki

A papermill engine that executes parameterized Jupyter notebooks inside disposable Tenki Sandbox microVMs.

Parameter injection happens locally in papermill as usual; the already parameterized notebook is uploaded to a fresh sandbox, executed there with jupyter nbconvert --execute, and the executed notebook (outputs, plots, errors) is downloaded and saved to papermill's output path. The sandbox is destroyed afterwards.

Install

pip install papermill-tenki

Setup

export TENKI_API_KEY=tk_...          # from your Tenki workspace settings
export TENKI_PROJECT_ID=...          # project to create sandboxes in

Usage

CLI (-p name value injects a notebook parameter, only if the notebook has a parameters cell that declares it):

papermill input.ipynb output.ipynb --engine tenki -p learning_rate 0.5

Python:

import papermill

papermill.execute_notebook(
    "input.ipynb",
    "output.ipynb",
    engine_name="tenki",
    # notebook parameters — only for notebooks with a `parameters` cell; omit otherwise:
    parameters={"learning_rate": 0.5},
    # optional engine kwargs (override env vars); see Configuration below:
    # project_id="...", image="...", sandbox_name="my-run",
    # cpu_cores=4, memory_mb=8192,
)

bootstrap is enabled by default and installs the jupyter toolchain in the sandbox for you — only set bootstrap=False if your image already has it.

Configuration

Engine kwarg Env var Default Meaning
project_id TENKI_PROJECT_ID — (required) Tenki project the sandbox is created in
image TENKI_IMAGE Tenki default Sandbox image
sandbox_name — papermill Sandbox display name
bootstrap TENKI_BOOTSTRAP enabled pip-install nbconvert/ipykernel when missing
cpu_cores — Tenki default Sandbox CPU cores
memory_mb — Tenki default Sandbox memory
max_duration — from execution_timeout Lifetime backstop (s); a crashed run can't orphan the VM
create_timeout — 300 Seconds to wait for the sandbox to reach RUNNING

TENKI_API_KEY is read by the Tenki SDK itself.

Notebook dependencies (numpy, pandas, ...) must exist in the sandbox: bake them into a custom image, or add a bootstrap cell at the top of the notebook. The kernel requested by the notebook must be installed in the sandbox; when it isn't and python3 is available, the engine falls back to python3 with a warning.

Timeouts

papermill's --start-timeout and --execution-timeout are forwarded to the remote nbconvert run (startup_timeout / timeout on the ExecutePreprocessor).

Tests

pip install -e .[dev]
pytest                       # unit tests, fully mocked, no network
TENKI_API_KEY=... TENKI_PROJECT_ID=... pytest tests/test_live_smoke.py   # live smoke test

Metadata

Release files for papermill-tenki 0.1.3

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

Source distribution (sdist)

Source distribution for papermill-tenki 0.1.3
File Size Uploaded
papermill_tenki-0.1.3.tar.gz 10.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for papermill-tenki 0.1.3
File Interpreter ABI Platform
papermill_tenki-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 18.3 kB

Release files / papermill_tenki-0.1.3.tar.gz

Download URL papermill_tenki-0.1.3.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
acde71ac2635a2bc79cb7467c5401a8c57cb908671efac828d959dc3fdd7e392
BLAKE2b-256 checksum
How to use checksums
a786ec7056422193ad72baef7c76d86265e6f432487b37de8508a0e3f611890c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 22, 2026.

Transparency log

Release files / papermill_tenki-0.1.3-py3-none-any.whl

Download URL papermill_tenki-0.1.3-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
422aa609866f87c198d7346dd1450a913ca6808d0bb16a3ecc40bb6518d5f9d3
BLAKE2b-256 checksum
How to use checksums
a7089eb9b0e350181f4becc0f6ba654d005d9be88d49f2be1cda2a2ff764a66f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 22, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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