Skip to main content

The noteable API interface

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

papermill_origami-0.0.27.tar.gz (30.2 kB view details)

Uploaded Source

Built Distribution

papermill_origami-0.0.27-py3-none-any.whl (38.0 kB view details)

Uploaded Python 3

File details

Details for the file papermill_origami-0.0.27.tar.gz.

File metadata

  • Download URL: papermill_origami-0.0.27.tar.gz
  • Upload date:
  • Size: 30.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.2 Linux/5.15.0-1039-azure

File hashes

Hashes for papermill_origami-0.0.27.tar.gz
Algorithm Hash digest
SHA256 18d543220182e344044ee27182b1af81c2f6a3390e326c5037df50cd4b0ad1af
MD5 1fba50e3830c12ce1311d36b31f6c28e
BLAKE2b-256 ab0588471e8622485e221a325fa564b11288edf31479c757378ebe4d6326b443

See more details on using hashes here.

File details

Details for the file papermill_origami-0.0.27-py3-none-any.whl.

File metadata

  • Download URL: papermill_origami-0.0.27-py3-none-any.whl
  • Upload date:
  • Size: 38.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.2 Linux/5.15.0-1039-azure

File hashes

Hashes for papermill_origami-0.0.27-py3-none-any.whl
Algorithm Hash digest
SHA256 398b620310cb8d64a2b3a69279b676f77ed006dfdb704ea2b885428ac8bf61dc
MD5 5ee65a4a6b6a81564bff3512c4f5871b
BLAKE2b-256 1a5df89b9095a84a0e70b85cd96d8d8c597c2cc42bffb0dabd0703c6eda43176

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page