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

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.9.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

nbappinator-0.1.9-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nbappinator-0.1.9.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for nbappinator-0.1.9.tar.gz
Algorithm Hash digest
SHA256 fd4857bf5b0f30c71d0a1102609c96641a6006f6be446892f79afc11cd93dfe8
MD5 8a32b5c91648578332f5728f11f4f123
BLAKE2b-256 5918c77dc45af276b223acae12b877e0e28b1d36bcd59715d2c740cdf227569c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nbappinator-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for nbappinator-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 ae163c062dc32380032edadaa07b2c1ff37c945bce93556e91552332467442a2
MD5 6a95b3dda4ee7f4797b542b36caf7e24
BLAKE2b-256 931bfabe598e7a70fd0210ae93421317ccc7a9042d56bb9b7d02bab3df08c834

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