Skip to main content

A collaborative notebook built for data scientists

Project description

Zero True Logo

Zero True: A New Kind of Code Notebook

🌐 Overview

Welcome to Zero True, your go-to platform for creating beautiful and professional data-driven notebooks and applications in pure Python. Designed to foster collaboration and improve data accessibility, Zero True offers a rich UI library along with an intelligent code parser. Your notebook will always stay in sync.

📚 Table of Contents

Features

  • 📝 Python + SQL reactive computational notebook.
  • 🌌 No hidden state. Our reactive cell updates show you what your notebook looks like in real time.
  • 📊 Dynamic UI rendering with beautiful Vuetify components.
  • 🔄 Automatic dependency tracking between cells.
  • 🚀 Integrated app publishing with a simple command.

⚙ Requirements

  • Python 3.9 (Anaconda or virtual environment recommended)

🚀 Quick Start

pip install zero-true
zero-true notebook

Usage

Once the application is running, navigate to http://localhost:1326 and start creating and executing code cells. Click the "Run" button to execute code and visualize the output below the editor.

Basic Example

import zero_true as zt
slider = zt.Slider(id='slider_1')
print('The squared value is '+str(slider.value**2))

More Complicated Example using Python + SQL

For this example you will need scikitlearn

pip install scikit-learn

Once it has installed, launch your notebook. We will be using the Iris dataset from scikit learn to create an app where people can filter the data using the our UI components and SQL editor. We start with a Python cell:

import zero_true as zt
import sklearn
import pandas as pd
from sklearn import datasets
iris = datasets.load_iris()
# Creating a DataFrame with the feature data
iris_df = pd.DataFrame(data=iris.data, columns=iris.feature_names)
# Map the target indices to target names
iris_df['target'] = iris.target
iris_df['target_name'] = iris_df['target'].apply(lambda x: iris.target_names[x])
# Rename columns to remove spaces and standardize
iris_df.columns = [col.replace(' ', '_').replace('(cm)', 'cm') for col in iris_df.columns]
iris_df.columns = [ col.replace(' ','_').replace('(cm)','cm') for col in iris_df.columns]
iris_df.drop('target',axis=1,inplace = True)
#all the different sliders
sepal_width_slider  = zt.RangeSlider(id = 'sepal_width',
                                     min = iris_df.sepal_width_cm.min(),
                                     max = iris_df.sepal_width_cm.max(),
                                     step = 0.1,label = 'Sepal Width')
petal_width_slider  = zt.RangeSlider(id = 'petal_width',
                                     min = iris_df.petal_width_cm.min(),
                                     max = iris_df.petal_width_cm.max(),
                                     step = 0.1,label = 'Petal Width')
sepal_length_slider = zt.RangeSlider(id = 'sepal_length',
                                     min = iris_df.sepal_length_cm.min(),
                                     max = iris_df.sepal_length_cm.max(),
                                     step = 0.1, label = 'Sepal Length')
petal_length_slider = zt.RangeSlider(id = 'petal_lenght',
                                     min = iris_df.petal_length_cm.min(),
                                     max = iris_df.petal_length_cm.max(),
                                     step = 0.1, label = 'Petal Length')

Then add a SQL cell below to query the dataframe. Notice how we can query a pandas dataframe directly and reference our UI components in the query:

SELECT * FROM iris_df
WHERE (sepal_length_cm BETWEEN {sepal_length_slider.value[0]} AND {sepal_length_slider.value[1]})
AND  (sepal_width_cm BETWEEN {sepal_width_slider.value[0]} AND {sepal_width_slider.value[1]})
AND  (petal_width_cm BETWEEN {petal_width_slider.value[0]} AND {petal_width_slider.value[1]})
AND (petal_length_cm BETWEEN {petal_length_slider.value[0]} AND {petal_length_slider.value[1]})

Notice how dragging the slider will update the dataframe. Set the parameters for your Iris bouquet and check out the data! You can see a published app for this example.

More Complicated Example

We support a large range of use cases and UI components. For more information please check out our docs: docs! You can also find some more narrative tutorials at our Medium publication here.

Publishing

Publishing your notebook is easy. Currently it's a one liner from the command line:

zero-true publish [api-key] [user-name] [project-name] [project-source]

Publishing is only open to a limited audience. If you are interested in publishing your notebook at a URL in our public cloud please fill out the email waiting list on our website.

Community

Reach out on GitHub with any feature requests or bugs that you encounter and share your work with us on Twitter/X! We are also active on linkedin. We would love to see what you're able to build using Zero-True.

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

zero-true-0.0.dev57.tar.gz (12.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zero_true-0.0.dev57-py3-none-any.whl (12.8 MB view details)

Uploaded Python 3

File details

Details for the file zero-true-0.0.dev57.tar.gz.

File metadata

  • Download URL: zero-true-0.0.dev57.tar.gz
  • Upload date:
  • Size: 12.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for zero-true-0.0.dev57.tar.gz
Algorithm Hash digest
SHA256 a2071ee2d3f87a89db749233f3f26a2d7ecbce8f8e559870546c707f7dfd2325
MD5 713e8b8a47b5e889ecfd9311264728a2
BLAKE2b-256 097a0a5833f021f9ab59c6e56ad581020908372d9a8b714b3fcdd2f72ae9c2f2

See more details on using hashes here.

File details

Details for the file zero_true-0.0.dev57-py3-none-any.whl.

File metadata

  • Download URL: zero_true-0.0.dev57-py3-none-any.whl
  • Upload date:
  • Size: 12.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for zero_true-0.0.dev57-py3-none-any.whl
Algorithm Hash digest
SHA256 01ee9d6409bf7ce9554e254e87b11feb5d0ca549e411ce1f6bb8c096f940cfaa
MD5 8a561e721f9eaa31ff091a93dd4a72c7
BLAKE2b-256 578899900669e65c72b66af164c2b555d74adc564df7ac578121e65094d24eee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page