solara-1.9.0
توضیحات
-
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | solara-1.9.0 |
| نام | solara |
| نسخه کتابخانه | 1.9.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | "Maarten A. Breddels" <maartenbreddels@gmail.com> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/solara/ |
| مجوز | The MIT License (MIT) Copyright (c) 2022 Maarten A. Breddels Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
**A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps**
[](https://solara.dev)
Come chat with us on [Discord](https://discord.solara.dev) to ask questions or share your thoughts or creations!
[](https://discord.solara.dev)
## Introducing Solara
While there are many Python web frameworks out there, most are designed for small data apps or use paradigms unproven for larger scale. Code organization, reusability, and state tend to suffer as apps grow in complexity, resulting in either spaghetti code or offloading to a React application.
Solara addresses this gap. Using a React-like API, we don't need to worry about scalability. React has already proven its ability to support the world's largest web apps.
Solara uses a pure Python implementation of React (Reacton), creating ipywidget-based applications. These apps work both inside the Jupyter Notebook and as standalone web apps with frameworks like FastAPI. This paradigm enables component-based code and incredibly simple state management.
By building on top of ipywidgets, we automatically leverage an existing ecosystem of widgets and run on many platforms, including JupyterLab, Jupyter Notebook, Voilà, Google Colab, DataBricks, JetBrains Datalore, and more.
We care about developer experience. Solara will give your hot code reloading and type hints for faster development.
## Installation
Run:
```
pip install solara
```
Or follow the [Installation instructions](https://solara.dev/documentation/getting_started/installing) for more detailed instructions.
## First script
Put the following Python snippet in a file (we suggest `sol.py`), or put it in a Jupyter notebook cell:
```python
import solara
# Declare reactive variables at the top level. Components using these variables
# will be re-executed when their values change.
sentence = solara.reactive("Solara makes our team more productive.")
word_limit = solara.reactive(10)
@solara.component
def Page():
# Calculate word_count within the component to ensure re-execution when reactive variables change.
word_count = len(sentence.value.split())
solara.SliderInt("Word limit", value=word_limit, min=2, max=20)
solara.InputText(label="Your sentence", value=sentence, continuous_update=True)
# Display messages based on the current word count and word limit.
if word_count >= int(word_limit.value):
solara.Error(f"With {word_count} words, you passed the word limit of {word_limit.value}.")
elif word_count >= int(0.8 * word_limit.value):
solara.Warning(f"With {word_count} words, you are close to the word limit of {word_limit.value}.")
else:
solara.Success("Great short writing!")
# The following line is required only when running the code in a Jupyter notebook:
Page()
```
Run from the command line in the same directory where you put your file (`sol.py`):
```bash
$ solara run sol.py
Solara server is starting at http://localhost:8765
```
Or copy-paste this to a Jupyter notebook cell and execute it (the `Page()` expression at the end
will cause it to automatically render the component in the notebook).
See this snippet run live at https://solara.dev/documentation/getting_started
## Demo
The following demo app can be used to explore a dataset (build in or upload yourself) using
a scatter plot. The plot can be interacted with to filter the dataset, and the filtered dataset can
be downloaded.
* [Source code](https://github.com/widgetti/solara/blob/master/solara/website/pages/apps/scatter.py)
### Running in solara-server
The solara server is build on top of Starlette/FastAPI and runs standalone. Ideal for production use.

### Running in Jupyter
By building on top of ipywidgets, we automatically leverage an existing ecosystem of widgets and run on many platforms, including JupyterLab, Jupyter Notebook, Voilà, Google Colab, DataBricks, JetBrains Datalore, and more. This means our app can also run in Jupyter:

## Resources
Visit our main website or jump directly to the introduction
[](https://solara.dev/documentation)
[](https://solara.dev/documentation/getting_started)
*Note that the solara.dev website is created using Solara*
نیازمندی
| مقدار | نام |
|---|---|
| - | solara-server[dev,starlette]==1.57.3 |
| - | solara-ui[all]==1.57.3 |
| xtr | altair; |
| xtr | bqplot; |
| xtr | bqplot-image-gl; |
| xtr | bump2version; |
| xtr | codespell; |
| xtr | folium; |
| xtr | ipyaggrid; |
| xtr | ipycanvas; |
| xtr | ipyleaflet; |
| xtr | ipyreact; |
| xtr | matplotlib; |
| xtr | mdit-py-plugins; |
| xtr | mkdocs-pycafe; |
| xtr | mypy; |
| xtr | numpy<2; |
| xtr | objgraph; |
| xtr | openai; |
| xtr | playwright; |
| xtr | plotly; |
| xtr | polars; |
| xtr | pre-commit; |
| xtr | pytest; |
| xtr | pytest-cov; |
| xtr | pytest-ipywidgets[all]==1.57.3; |
| xtr | pytest-mock; |
| xtr | pytest-playwright; |
| xtr | pytest-timeout; |
| xtr | pytest-tornasync; |
| xtr | python-dotenv; |
| xtr | ruff; |
| xtr | solara-assets==1.57.3; |
| ython_versio | tiktoken; |
| xtr | types-markdown; |
| xtr | types-pyyaml; |
| xtr | types-requests; |
| ython_versio | vaex-core; |
| ython_versio | vaex-hdf5; |
| ython_versio | vaex-jupyter; |
| xtr | vega-datasets; |
| xtr | solara-assets==1.57.3; |
| xtr | bqplot; |
| xtr | bqplot-image-gl; |
| xtr | bump2version; |
| xtr | codespell; |
| xtr | ipyaggrid; |
| xtr | ipyreact; |
| xtr | mdit-py-plugins; |
| xtr | mypy; |
| xtr | numpy<2; |
| xtr | objgraph; |
| xtr | playwright; |
| xtr | plotly; |
| xtr | polars; |
| xtr | pre-commit; |
| xtr | pytest; |
| xtr | pytest-cov; |
| xtr | pytest-mock; |
| xtr | pytest-playwright; |
| xtr | pytest-timeout; |
| xtr | pytest-tornasync; |
| xtr | python-dotenv; |
| xtr | ruff; |
| xtr | types-markdown; |
| xtr | types-pyyaml; |
| xtr | types-requests; |
| ython_versio | vaex-core; |
| ython_versio | vaex-hdf5; |
| ython_versio | vaex-jupyter; |
| xtr | altair; |
| xtr | bqplot; |
| xtr | folium; |
| xtr | ipycanvas; |
| xtr | ipyleaflet; |
| xtr | matplotlib; |
| xtr | mkdocs-pycafe; |
| xtr | numpy<2; |
| xtr | openai; |
| xtr | plotly; |
| ython_versio | tiktoken; |
| ython_versio | vaex-core; |
| ython_versio | vaex-hdf5; |
| xtr | vega-datasets; |
| xtr | pytest-ipywidgets[all]==1.57.3; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8 | Python |
نحوه نصب
نصب پکیج whl solara-1.9.0:
pip install solara-1.9.0.whl
نصب پکیج tar.gz solara-1.9.0:
pip install solara-1.9.0.tar.gz