Skip to content

Cuttle automates the transformation of your Python notebook into deployment-ready projects (API, ML pipeline, or just a Python script)

License

Notifications You must be signed in to change notification settings

CuttleLabs/cuttle-cli

Repository files navigation

alt text

Cuttle CLI

made-with-python PyPI version Twitter Follow Unit Tests Downloads

Converting a Python notebook into a deployable project is hard and shifts the source of truth away from your initial development environment. Cuttle uses code generation to automate transformation of your notebook into deployable python projects (ex. Airflow pipeline, Flask API or just a Python script) without writing any extra code.

😎 Features

  • Tranformer plugins making it possible to support any number of output projects.
  • Environment support to allow different configurations and transformations for the same notebook.
  • Easy to integrate into your Dev Ops pipeline.

⬇ Installation

$ pip install cuttle

🚀 Getting Started

Cuttle needs to be initialized in the same folder as your notebook project.

cuttle init
cuttle create <new environment name> --transformer <plugin-name>

This should create a cuttle.json file which can be pushed to the project git repository.

Cuttle configuration is either cell or line scoped. Cell scoped commands need to be mentioned at the top of the cell while line scoped commands are to be mentioned at the end of the line of code.

Cell Scoped Configuration

Disabling Cells

Omits the code present in the cell from the output project.

#cuttle-environment-disable <environment>
....

Setting Configuration

Sets configuration needed during transformation. Check transformer documentation for possible keys.

#cuttle-environment-set-config <environment> <key>=<value>
...

Line Scoped Configuration

Getting Variable Value

Sets value of variable to global environment configuration value in cuttle.json

a = 2 #cuttle-environment-get-config <environment> <key>
...

Assign Transformer Provided Dependency

Sets value of variable to dependency provided by transformer. Check transformer documentation for available dependencies.

a = 2 #cuttle-environment-assign <environment> <dependency>
...

Transform

Creates transformed project in output folder.

cuttle transform <environment>

🤓 Transformer Plugin Documentation

Flask API

⭐ For Contributors

Building locally

python setup.py sdist bdist_wheel

Install using source

python setup.py install

Check contents of package

tar tzf dist/cuttle-<version>.tar.gz

About

Cuttle automates the transformation of your Python notebook into deployment-ready projects (API, ML pipeline, or just a Python script)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages