用于快速构建 基于python的web应用

Nam Nguyen e57a2742b1 Merge branch 'develop' into feature/#1429-number-step-attribute 10 달 전
.github 16e90fba5b use taipy-assets favicon (#1453) 11 달 전
doc 04811fdd54 Merge branch 'develop' into feature/#1429-number-step-attribute 11 달 전
frontend 3de0dcdf20 correct the comment 10 달 전
readme_img 94503b8d01 banner_changes (#1408) 11 달 전
taipy e57a2742b1 Merge branch 'develop' into feature/#1429-number-step-attribute 10 달 전
tests c135048786 support lambda in gui builder (#1476) 10 달 전
tools 98a4b52255 python doc html to markdown (#1458) 11 달 전
.editorconfig 356260bd3b fix: update markdown format 1 년 전
.gitattributes 7f0b872e89 Add taipy-rest package (#13) 3 년 전
.gitignore 21925680a7 feat: clean up .gitignore files 1 년 전
.license-header 569f29cc06 Change year in copyright 1 년 전
.pre-commit-config.yaml 64478fffc5 feat: enable mypy type checker 1 년 전
CODE_OF_CONDUCT.md 4d3e5d6e5b Search box in scenario management elements selector control (#1310) 1 년 전
CONTRIBUTING.md 1557541a18 Update CONTRIBUTING.md 1 년 전
INSTALLATION.md e47c7bf57c fix: remove $ from bash example to allow the user to copy the commands 1 년 전
LICENSE 662da8f227 Update LICENSE 1 년 전
MANIFEST.in 356260bd3b fix: update markdown format 1 년 전
Pipfile 98a4b52255 python doc html to markdown (#1458) 11 달 전
README.md 5380921ee4 Update banner to drive to Designer 10 달 전
SECURITY.md 33a2151731 Create SECURITY.md 1 년 전
contributors.txt fc6d311771 Remove hover_text from Indicator (#1282) 11 달 전
mypy.ini 3431b8c8a5 feat: replace python-linter with mypy specific action 1 년 전
package_desc.md 404685dab0 fix: remove the test, contributing, and code of conduct sections from the package long description 1 년 전
pyproject.toml 35ab038b18 chore: reset orchestrator after end to end test 1 년 전
pytest.ini f5a18ef9f8 Remove modin dependency. compatibility is guaranteed by falling back on pandas. 1 년 전
setup.py 4608b56192 feat: add security link and update release version in the release-note link 1 년 전

README.md

Taipy Designer banner

Build Python Data & AI web applications

From simple pilots to production-ready web applications in no time. No more compromise on performance, customization, and scalability.


**Go beyond existing libraries**

<br />
<a href="https://docs.taipy.io/en/latest/"><strong>📚 Explore the docs </strong></a>
<br />
<a href="https://discord.com/invite/SJyz2VJGxV">  🫱🏼‍🫲🏼 Discord support</a>
<br />
<a href="https://docs.taipy.io/en/latest/gallery/"> 👀 Demos & Examples</a>

 

⭐️ What's Taipy?

Taipy is designed for data scientists and machine learning engineers to build data & AI web applications.  

⭐️ Enables building production-ready web applications.
⭐️ No need to learn new languages. Only Python is needed.
⭐️ Concentrate on Data and AI algorithms without development and deployment complexities.

 

Taipy is a Two-in-One Tool for UI Generation and Scenario/Data Management


User Interface Generation Scenario and Data Management
Interface Animation Back-End Animation

 

✨ Features

Scenario Banner Back-End Animation Back-End Animation

 

⚙️ Quickstart

To install Taipy stable release run:

pip install taipy

To install Taipy on a Conda Environment or from source, please refer to the Installation Guide.
To get started with Taipy, please refer to the Getting Started Guide.

 

🔌 Scenario and Data Management

Let's create a scenario in Taipy that allows you to filter movie data based on your chosen genre.
This scenario is designed as a straightforward pipeline.
Every time you change your genre selection, the scenario runs to process your request.
It then displays the top seven most popular movies in that genre.


⚠️ Keep in mind, in this example, we're using a very basic pipeline that consists of just one task. However,
Taipy is capable of handling much more complex pipelines 🚀


Below is our filter function. This is a typical Python function and it's the only task used in this 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

Taipy Studio

You can use the Taipy Studio extension in Visual Studio Code to configure your scenario with no code
Your configuration is automatically saved as a TOML file.
Check out Taipy Studio Documentation

For more advanced use cases or if you prefer coding your configurations instead of using Taipy Studio,
Check out the movie genre demo scenario creation with this Demo.

TaipyStudio

 

User Interface Generation and Scenario & Data Management

This simple Taipy application demonstrates how to create a basic film recommendation system using Taipy.
The application filters a dataset of films based on the user's selected genre and displays the top seven films in that genre by popularity. Here is the full code for both the frontend and backend of the application.

import taipy as tp
import pandas as pd
from taipy import Config, Scope, Gui

# Taipy Scenario & Data Management

# 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 Core service
tp.Core().run()

# Create a scenario
scenario = tp.create_scenario(scenario_cfg)


# Taipy User Interface
# Let's add a GUI to our Scenario Management 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 = "Action"

## Set initial value to Action
def on_init(state):
    on_genre_selected(state)

# 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()

And the final result:

 

⚒️ Contributing

Want to help build Taipy? Check out our Contributing Guide.

🪄 Code of conduct

Want to be part of the Taipy community? Check out our Code of Conduct

🪪 License

Copyright 2021-2024 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.