Skip to main content

Paperless

Paperless is a tool that extends the capabilities of Papermill by providing the ability to run Papermill via Google Cloud Dataproc Serverless.

Overview

Papermill is a powerful tool for parameterizing and executing Jupyter Notebooks. However, by default papermill dosn't support Jupyter Kernel Gateway - it was impossible to run spark notebook vs Google Cloud Dataproc Serverless environment with Papermill tool - this is where Paperless helps.

Paperless bridges the gap between Papermill and Google Cloud Dataproc Serverless interactive mode, allowing you to seamlessly integrate the two and harness the power of serverless execution for your Jupyter Notebooks.

Features

  • Serverless Execution: Run Papermill on Google Cloud Dataproc without managing the underlying infrastructure.

  • Scalability: Leverage the scalability of Google Cloud Dataproc for processing multiple Notebooks concurrently.

  • Cost-Effective: Pay only for the resources you consume during the execution, optimizing costs for your notebook parameterization tasks.

Pricing model is much more cost-effective considering other platofrms and technologies

https://cloud.google.com/dataproc-serverless/pricing resource: https://cloud.google.com/dataproc-serverless/pricing

Getting Started

Prerequisites

Before using Paperless, make sure you have the following:

  • A Google Cloud Platform (GCP) project
  • Access to Google Cloud Dataproc Enable the API
  • Papermill installed locally or in your environment

Step 1: Install Google Cloud SDK

To authenticate your application using Application Default Credentials (ADC) with gcloud - If you haven't already installed the Google Cloud SDK, you can download and install it from the Google Cloud SDK documentation.

Step 2: Authenticate with gcloud

Open a terminal and run the following command to authenticate your Google Cloud SDK with your Google Cloud Platform (GCP) account:

gcloud auth login

gcloud auth application-default login 

gcloud config set project <project_id>

gcloud config set compute/region <region>

gcloud config set dataproc/region <region>

Step 3: Install Paperless

pip install paperless

Step 4: Create sessionTemplates For Paperless

Parameters and details can be found in GCP Docs.

The default template name is: paperless-interactive

 gcloud compute instance-templates create paperless-interactive --<extra params...>

You can change parameters as you need based on the jobs needs - check the docs for that.

Step 5: Test Executtion:

Paperless excepts && supports all list or arguments exists in original Papermill package - the minimum needed for testing:

 paperless <input_path> <output_path> ...

An extra environment variable that is special for Paperless: TEMPLATE_NAME=paperless-interactive Example:

 export TEMPLATE_NAME=paperless-interactive && \
     paperless ./resources/spark.ipynb ./resources/spark-out.ipynb

You're all set, enjoy :)


Local development:

# Create a new directory for your project
git clone https://github.com/Plarium-Repo/paperless.git && cd paperless

# Create a virtual environment
python3 -m venv .venv

# Activate the virtual environment
# On Windows
.venv\Scripts\activate

# On macOS and Linux
source venv/bin/activate

# Install requirements
pip install -r requirements.txt

# Install the command line
python setup.py install 

# Execute example
export TEMPLATE_NAME=paperless-interactive && ./.venv/bin/paperless ./tests/resources/test.ipynb ./tests/resources/test-out.ipynb

Made With Love ❤️ from 🇮🇱 🇮🇱


MIT License

Contribution

Code Of Conduct

Metadata

Release files for paperless 1.5.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 paperless 1.5.3
File Size Uploaded
paperless-1.5.3.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for paperless 1.5.3
File Interpreter ABI Platform
paperless-1.5.3-py3-none-any.whl Python 3 none any Details

Total release size: 22.4 kB

Release files / paperless-1.5.3.tar.gz

Download URL paperless-1.5.3.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f7583711aea6478e61b1ca9c27b9f0f30c7a8a521e7118e0010aef421b89c53e
BLAKE2b-256 checksum
How to use checksums
d69095666c7ded1476bdf8e4195a84c7d6972947f886753d694cf8a1d33d0554
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / paperless-1.5.3-py3-none-any.whl

Download URL paperless-1.5.3-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e5dfd0e3b8fed30622d74f34f48569f8d75c89d8eae31a0628490a2cb21903f5
BLAKE2b-256 checksum
How to use checksums
4fff2f09c90d4827104ddda424290b147d1fafeee8a0845d1cdd37709f44c957
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

1.5.3 This release

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.7

2 release files

1.4.4

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.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