1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Streamlitの書きやすさでReactの反応性を。Pythonの新Webフレームワーク「Violit」

1
Posted at

image.png

はじめに

Pythonでデータ可視化やAIデモを構築する際、Streamlitは非常に強力なツールです。しかし、プロジェクトが大きくなるにつれ、「Full-Script Rerun(スクリプト全体の再実行)」によるパフォーマンスの低下や、デザインのカスタマイズ性に限界を感じることはありませんか?

この課題を解決するために、Streamlitの直感的な構文を維持しつつ、**Reactのような細粒度の反応性(Fine-grained Reactivity)**を実現した新しいオープンソースフレームワーク Violit(バイオリット) を開発しました。

Violitの3つの主要な特徴

  1. No Full Rerun : ページ全体を再ロードしません。状態(State)が変化したコンポーネントのみをピンポイントで更新します。
  2. Zero Learning Curve : Streamlitユーザーなら、わずか10分で使いこなせます。
  3. Beautiful by Default : 20種類以上のテーマ(Cyberpunk, Dracula, Vaporwaveなど)をコード1行で適用可能です。

violit_light_jewel_DEFAULT.png

コード例

複雑なコールバックやJavaScriptの知識は不要です。

import violit as vl

app = vl.App(title="Violit Demo")
count = app.state(0)

# ボタンをクリックしてもスク리プト全体は再実行されず、countだけが更新されます
app.button("Increment", on_click=lambda: count.set(count.value + 1))
app.text("Current Count:", count)

app.run()

ベンチマーク結果

大量のデータを扱う際、ViolitはRerunのオーバーヘッドがないため、圧倒的なスピードを実現します。

Data Points Streamlit Rendering Violit Rendering
100K ~62ms ~14ms
500K ~174ms ~20ms
1M ~307ms ~24ms

おわりに

Violitは、単なるStreamlitの代替品ではなく、Pythonだけで完結する**本格的なWebサービス(MVP)**の構築を可能にすることを目指しています。 現在、GitHubで絶賛開発中(v0.1.12)です。ぜひ一度触ってみて、フィードバックをいただけると嬉しいです!

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?