Skip to main content

papermill-origami

A papermill engine for running Noteable notebooks

CI PyPI - License PyPI - Python Version PyPI Code style: black


Install | Getting Started | Documentation | License | Code of Conduct | Contributing

Intro to Papermill-Origami

Papermill-Origami is the bridge library between the Origami Noteable SDK and Papermill. The papermill engine can talk to Noteable APIs to run Notebooks.

Requirements

Python 3.8+

Installation

Poetry

poetry add papermill-origami

Pip

pip install papermill-origami

Getting Started

API Token

Get your access token from your User Settings -> API Tokens

or alternatively you can generate a post request to generate a new token

curl -X 'POST' \
  'https://app.noteable.io/gate/api/v1/tokens' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "ttl": 31536000,
  "name": "my_token"
}'

Engine Registration

The noteable engine keyword will use the following environment variables by default:

NOTEABLE_DOMAIN = app.noteable.io
NOTEABLE_TOKEN = MY_TOKEN_VALUE_HERE

Then the engine is enabled by running papermill as normal. But now you have access to the noteable:// scheme as well as the ability to tell papermill to use Noteable as the execution location for your notebook.

import papermill as pm

file_id = '...'

pm.execute_notebook(
    f'noteable://{file_id}',
    None, # Set no particular output notebook, but a log of the resulting exeuction link still prints
    # This turns on the Noteable API interface
    engine_name='noteable', # exclude this kwarg to run the Notebook locally
)

Advanced Setup

For more advanced control or reuse of a NoteableClient SDK object you can use the async await pattern around a client constructor. This reuses the connection throughout the life cycle of the context block.

import papermill as pm
from papermill.iorw import papermill_io
from papermill_origami import ClientConfig, NoteableClient, NoteableHandler 


domain = 'app.noteable.io'
token = MY_TOKEN_VALUE_HERE
file_id = '...'

async with NoteableClient(token, config=ClientConfig(domain=domain)) as client:
    file = await client.get_notebook(file_id)
    papermill_io.register("noteable://", NoteableHandler(client))
    pm.execute_notebook(
        f'noteable://{file_id}',
        None,
        engine_name='noteable',
        # Noteable-specific kwargs
        file=file,
        client=client,
    )

Contributing

See CONTRIBUTING.md.


Open sourced with ❤️ by Noteable for the community.

Boost Data Collaboration with Notebooks

Release files for papermill-origami 0.0.30

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-origami 0.0.30
File Size Uploaded
papermill_origami-0.0.30.tar.gz 28.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for papermill-origami 0.0.30
File Interpreter ABI Platform
papermill_origami-0.0.30-py3-none-any.whl Python 3 none any Details

Total release size: 64.3 kB

Release files / papermill_origami-0.0.30.tar.gz

Download URL papermill_origami-0.0.30.tar.gz
Size 28.5 kB
Tags Source
SHA-256 checksum
How to use checksums
dda5569d265ccab46bdba29a8c43553d0561e5d2046e3b2d02467555bb49b8c0
BLAKE2b-256 checksum
How to use checksums
a94c798ecb2f1e46eb8ed9e95ea1bc8783b5de595a66add79b9588087404577a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.2 Linux/5.15.0-1047-azure

Release files / papermill_origami-0.0.30-py3-none-any.whl

Download URL papermill_origami-0.0.30-py3-none-any.whl
Size 35.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8f6369b9fc49d1e2b62a843ad1e98580d5451f103dd45383bbfe2df06c358a2
BLAKE2b-256 checksum
How to use checksums
5b807f8176957cfdc572c058a9cff3fde4186dd4e937f192c80f2e6db2d8f72f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.2 Linux/5.15.0-1047-azure

Release history Release notifications | RSS feed

This release

0.0.30 This release

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.11

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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