AutoServer
AutoServer is a python library for making quick web UIs, it was originally made for HackEd 2023.
Example
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()
Metadata
Release files for autoserver 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| autoserver-0.1.0.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autoserver-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.4 kB
Release files / autoserver-0.1.0.tar.gz
| Download URL | autoserver-0.1.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40f0390bacd3a3ecff53f8e8f75aea94ef79174b8dd66bf12aabc0efe3ef2edd
|
|
BLAKE2b-256 checksum How to use checksums |
de1aa9dd669f48e67fc387b1bc420688d7d182c80912d36d971aaf77175c1338
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.10.7 Windows/10
|
Release files / autoserver-0.1.0-py3-none-any.whl
| Download URL | autoserver-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6aad14518374b7ed7066925c4a45b594924d0568a24cae44e6fdbb0bcb3d73f
|
|
BLAKE2b-256 checksum How to use checksums |
ab4a717cf88e7e52a3109b1467f3bc8f64ecbe3fb93569dcd359db80451d0002
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.10.7 Windows/10
|