Skip to main content

Jupyter Notebook Application Builder

Project description

PyPI Version Anaconda-Server Badge Tests Tests

Coverage badge2

Introduction

nbappinator streamlines Jupyter and Voila app development through a structured, opinionated framework for UI construction. Adding a button to a page is as simple as using app.page[0].add_button(...).

nbappinator has three goals:

  • Simplify UI development for Notebook developers by reducing the surface area of APIs to learn.
  • Abstract the underlying UI components, allowing nbappinator to plug in different frameworks to achieve equivalent behavior.
  • Provide a foundation to develop reusable and portable themes to improve app styling.

Example

Example

Getting Started

import nbappinator as nbapp

def my_action(component, action, args, app: nbapp.UiModel, caller: str):
    with app.messages:
        print("This message will be written to the Messages footer")
        app.get_page(0).add_textstatic("This is some text")

def choose_action(component, action, args, app: nbapp.UiModel, caller: str):
    with app.messages:
        chosen_value = app.get_values(caller)
        print(f"You chose {chosen_value}")
        app.get_page(1).add_textstatic(f"You chose {chosen_value}")

# Create a Tabbed UI comprised of three sections:
# "Config" Header,  Tabbed Pages: "First Tab" and "Second Tab", and a "Messages" Footer
myapp = nbapp.TabbedUiModel(pages=["First Tab", "Second Tab"], log_footer = "Messages", headers=["Config"])
myapp.get_page("Config").add_textstatic("This is static text in the Config section of the page. You could add global settings, buttons and other widgets here.")

# Add a button to First Tab
myapp.get_page(0).add_textstatic("This is the first tab")
myapp.get_page(0).add_button(name="but1", label="Some button", action=my_action)
myapp.get_page(0).add_textstatic("Click the button")

# Add a dropdown selection to Second Tab
myapp.get_page(1).add_select(name="choose1", label="Choose A Number", options=list(range(10)), action=choose_action)

# Render the app:
myapp.display()

Deployment and BQuant

nbappinator was originally designed to simplify developing applications within Bloomberg's BQuant environment, which provides a managed but locked down Jupyter environment with a Voila-based deployment of applications.

Acknowledgements

nbappinator builds on some great projects that provide useful building blocks in Jupyter, which themselves build on other great web technologies. At the same time, nbappinator is implementation agnostic - a core goal is to allow any of these components to be swapped out.

ipyvuetify provides the underlying UI widgets, bringing modern VUE components to Jupyter.

AG Grid is an excellent javascript grid library, which ipyaggrid provides as an Jupyter extension.

Plotly is given first class support, although any matplotlib charting library works, such as Seaborn.

This all builds on Jupyter and ipywidgets.

Testing Notes

A significant portion of the tests are Notebook smoketests designed to exercise the code base in its entirety. The coverage report primarily reflects the percentage of the code base that the Notebooks exercise: but manual verification of the Notebook behavior is still required.

Some assertions are baked into the Notebooks, but largely its intended to ensure that all the features are exercised.

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

nbappinator-0.1.4.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

nbappinator-0.1.4-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file nbappinator-0.1.4.tar.gz.

File metadata

  • Download URL: nbappinator-0.1.4.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for nbappinator-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a28d98c1c10822227859ad1f96f7a16746f4dca0d7fdcc49ea7127af07c8c4c9
MD5 6fca25c48f689983804b569eff5d967e
BLAKE2b-256 60dec6686bcb10f7f418df62200bc28dfceb2d8050b2a7ae18d997e6b4192e91

See more details on using hashes here.

File details

Details for the file nbappinator-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: nbappinator-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for nbappinator-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1d9c0010f6209363b1749061ba5c45f14ec0baa9e4b7ab35c6197ce3445441f5
MD5 4f2735cf1128f09ba2ff0373a2dca3cd
BLAKE2b-256 d4c69895e1548071ca7f350850d993d866869c9a4f9e2603e79762368419d935

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