autoserver-0.1.0
توضیحات
-
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | autoserver-0.1.0 |
| نام | autoserver |
| نسخه کتابخانه | 0.1.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | JanukanS |
| ایمیل نویسنده | 28988453+JanukanS@users.noreply.github.com |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/autoserver/ |
| مجوز | - |
# AutoServer
AutoServer is a python library for making quick web UIs, it was originally made for HackEd 2023.
## Example
```python
from autoserver import AutoServer
app = AutoServer()
@app.addfunc
def TaxCalc(province: str, cost: float, taxrate: int):
"""
Computes the amount of tax on an item given the tax rate
:param province: The name of the province
:param cost: The cost of the item expressed in dollars
:param taxrate: The tax rate expressed as a percentage
:return:
"""
tax = cost * float(taxrate) / 100
output = f"The tax in {province} for an item worth ${cost} is {tax}."
output += f"The total cost is ${cost + tax}."
return output
@app.addfunc
def TargetPrice(province: str, targetcost: float, taxrate: int):
targetRatio = 1.0 + float(taxrate) / 100
output = f"To have a final cost of ${targetcost} in {province},"
output += f"the pretax price should be ${targetcost / targetRatio}"
return output
app.run()
```
نیازمندی
| مقدار | نام |
|---|---|
| >=0.88.0,<0.89.0 | fastapi |
| >=3.1.2,<4.0.0 | jinja2 |
| >=0.20.0,<0.21.0 | uvicorn |
| >=0.0.5,<0.0.6 | python-multipart |
| >=0.15,<0.16 | docstring-parser |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8,<4.0 | Python |
نحوه نصب
نصب پکیج whl autoserver-0.1.0:
pip install autoserver-0.1.0.whl
نصب پکیج tar.gz autoserver-0.1.0:
pip install autoserver-0.1.0.tar.gz