Turns Data and AI algorithms into full web applications in no time. How? Taipy pops out as a 360Β° platform to build production-ready web applications
Open a terminal and run:
$ pip install taipy
You're all set! All aboard the Taipy journey π
Join our Discord to give us feedback, share your creations or just to have a chat with us.
Tiny Taipy Front-End Demo
from taipy import Gui
excitement_page = """
# Welcome to Taipy
## Getting started with Taipy
### How excited are you to try Taipy?
<|{excitement}|slider|min=1|max=100|>
My excitement level: <|{excitement}|text|>
"""
excitement = 100
Gui(page=excitement_page).run()
RUNππ½ββοΈ
Here is our filter function: a standard Python function that is used by the unique task in the scenario
def filter_genre(initial_dataset: pd.DataFrame, selected_genre):
filtered_dataset = initial_dataset[initial_dataset['genres'].str.contains(selected_genre)]
filtered_data = filtered_dataset.nlargest(7, 'Popularity %')
return filtered_data
This is the execution graph of the scenario we are implementing
You can use the Taipy Studio extension in VSCode to configure your sequence with no code
Your configuration is automatically saved as a TOML file
Now, let's load this configuration and add a user interface on top for a πFULL APPLICATIONπ
import taipy as tp
import pandas as pd
from taipy import Config, Scope, Gui
# TAIPY Core
# Filtering function - task
def filter_genre(initial_dataset: pd.DataFrame, selected_genre):
filtered_dataset = initial_dataset[initial_dataset['genres'].str.contains(selected_genre)]
filtered_data = filtered_dataset.nlargest(7, 'Popularity %')
return filtered_data
# Load the configuration made with Taipy Studio
Config.load('config.toml')
scenario_cfg = Config.scenarios['scenario']
# Start Taipy Back-End service
tp.Core().run()
# Create a scenario
scenario = tp.create_scenario(scenario_cfg)
# TAIPY Front-End
# Let's add a froent-end to our back-end for a full application
# Callback definition - submits scenario with genre selection
def on_genre_selected(state):
scenario.selected_genre_node.write(state.selected_genre)
tp.submit(scenario)
state.df = scenario.filtered_data.read()
# Get list of genres
genres = [
'Action', 'Adventure', 'Animation', 'Children', 'Comedy', 'Fantasy', 'IMAX'
'Romance','Sci-FI', 'Western', 'Crime', 'Mystery', 'Drama', 'Horror', 'Thriller', 'Film-Noir','War', 'Musical', 'Documentary'
]
# Initialization of variables
df = pd.DataFrame(columns=['Title', 'Popularity %'])
selected_genre = None
# User interface definition
my_page = """
# Film recommendation
## Choose your favorite genre
<|{selected_genre}|selector|lov={genres}|on_change=on_genre_selected|dropdown|>
## Here are the top seven picks by popularity
<|{df}|chart|x=Title|y=Popularity %|type=bar|title=Film Popularity|>
"""
Gui(page=my_page).run()
RUNππ½ββοΈ
Taipy greatly eases your web application deployment. It provides the most suitable cloud tool to host, deploy, and share your Taipy applications easily. In addition, this platform provides the ability to manage, store, and maintain the various states of your backend.
Want to help build Taipy? Check out our CONTRIBUTING.md
file.
Want to be part of the Taipy community? Check out our CODE_OF_CONDUCT.md
file.
Copyright 2023 Avaiga Private Limited
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.