The Banana CLI helps you build Potassium apps
Project description
banana-cli
v0; work in progress; not stable release
The goal of the Banana CLI is to bring an npm-like experience to ML development loops. This version includes:
banana init
to create a project with boilerplatebanana dev
to run a dev server with hot-reload when app.py changes
To use it
- Install the CLI with pip
pip3 install banana-cli==0.0.4
- Create a new project directory with
banana init my-app
cd my-app
- Start the hot reloading dev server
banana dev
For the current release you'll need to manually start a jupyter notebook backend. The banana dev
command will prompt you to input the auth token from that backend so the CLI can connect to it. This will be automatic in the future.
- Start the jupyter backend (in a separate terminal session):
From within your my-app
project directory:
python3 -m venv venv
. ./venv/bin/activate
pip3 install -r requirements.txt
jupyter notebook
- Copy the "token" string in the URL displayed in the terminal output. It should look like
115850cc76a1dd8b2880ccfa458f6f4d269876724eef92bc
Hot-Reload Dev Server
The interactive dev server works like a react, next, or nodemon server: it selectively hot reloads components when you save changes to different parts of your app.py
file.
The init() function is ran on startup and for every change to init().
The handler() function is ran on every change to handler(), without needing to wait for a long init()
It does this by pushing code in logical chunks to a jupyter notebook backend, to persist memory between reloads.
Play with it:
- Try changing the handler, see what happens!
- Try changing the init, see what happens!
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
Hashes for banana_cli-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17a912489833f52d0d1b92bc63099d964b0dbb3881af6cbbec99784ca8c64242 |
|
MD5 | cb5e6eb51fbe58614a185fb12aa3aa8a |
|
BLAKE2b-256 | dd1e75a0a49c28719c2671a2afa562ba9ab824e9d511ee4fe5789416440ac958 |