The noteable API interface
Project description
papermill-origami
A papermill engine for running Noteable notebooks
Install | Getting Started | License | Code of Conduct | Contributing
Intro to Papermill-Origami
Papermill-Origami is the bridge library between the Origami Noteable SDK and Papermill. It build a papermill engine that 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file papermill_origami-0.0.15.tar.gz
.
File metadata
- Download URL: papermill_origami-0.0.15.tar.gz
- Upload date:
- Size: 30.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.2 Linux/5.15.0-1023-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 106d171c00450a2ed8625a2fdbebcf2c607387f7d6c32dafc1dedf31fbf8842a |
|
MD5 | 6206db98b5efb0d549388403c9bee0bb |
|
BLAKE2b-256 | 52bc927948b3735b75212f90175656732b6a0c083c7da7b69ab713feba2bdd00 |
Provenance
File details
Details for the file papermill_origami-0.0.15-py3-none-any.whl
.
File metadata
- Download URL: papermill_origami-0.0.15-py3-none-any.whl
- Upload date:
- Size: 37.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.2 Linux/5.15.0-1023-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f0d06b116feb6ef470c47c66ca26fcb625bac9c084d10aeffa4ee31353cecb3 |
|
MD5 | 6ed3d76c8349b5213bd563345350c80b |
|
BLAKE2b-256 | c5fdf6c9595580b9dfb211a3b6562368ac2711a2254502bdd84030f077c7c6dc |