
## Introduction
Freesia is a concise and lightweight async web framework. Its api is inspired by Flask.
## Installation
```bash
pip3 install asyncfreesia
```
## Docs
You can find the project's detailed API documentation on [here](https://freesia.readthedocs.io/en/latest/?).
## Example
*hello world*
```python
from freesia import Freesia
app = Freesia()
@app.route('/hello/<name>')
async def hello(request, name):
return "Hello, " + name + "!"
if __name__ == "__main__":
app.run()
```
*middleware*
```python
from freesia import Freesia
app = Freesia()
@app.route("/<name>")
async def hello(request, name):
print("enter user handler")
return "hello, " + name
async def middleware1(request, handler):
print("enter middleware1")
res = await handler()
print("exit middleware1")
return res + " !"
async def middleware2(request, handler):
print("enter middleware2")
res = await handler()
print("exit middleware2")
return res + " :D"
app.use([middleware1, middleware2])
if __name__ == "__main__":
app.run()
```
*session*
```python
from freesia import Freesia, set_up_session, get_session, Response
from freesia.session import SimpleCookieSession
app = Freesia()
@app.route("/")
async def hello(request):
s = await get_session(request)
if "count" not in s:
s["count"] = 1
return Response(text="Hello, stranger!")
else:
s["count"] += 1
return Response(text="I've seen you %d times" % s["count"])
if __name__ == "__main__":
set_up_session(app, SimpleCookieSession)
app.run()
```
## More
You can see more exmaple and usags in [docs](https://freesia.readthedocs.io/en/latest/?) and [examples](./examples).
## Introduction
Freesia is a concise and lightweight async web framework. Its api is inspired by Flask.
## Installation
```bash
pip3 install asyncfreesia
```
## Docs
You can find the project's detailed API documentation on [here](https://freesia.readthedocs.io/en/latest/?).
## Example
*hello world*
```python
from freesia import Freesia
app = Freesia()
@app.route('/hello/<name>')
async def hello(request, name):
return "Hello, " + name + "!"
if __name__ == "__main__":
app.run()
```
*middleware*
```python
from freesia import Freesia
app = Freesia()
@app.route("/<name>")
async def hello(request, name):
print("enter user handler")
return "hello, " + name
async def middleware1(request, handler):
print("enter middleware1")
res = await handler()
print("exit middleware1")
return res + " !"
async def middleware2(request, handler):
print("enter middleware2")
res = await handler()
print("exit middleware2")
return res + " :D"
app.use([middleware1, middleware2])
if __name__ == "__main__":
app.run()
```
*session*
```python
from freesia import Freesia, set_up_session, get_session, Response
from freesia.session import SimpleCookieSession
app = Freesia()
@app.route("/")
async def hello(request):
s = await get_session(request)
if "count" not in s:
s["count"] = 1
return Response(text="Hello, stranger!")
else:
s["count"] += 1
return Response(text="I've seen you %d times" % s["count"])
if __name__ == "__main__":
set_up_session(app, SimpleCookieSession)
app.run()
```
## More
You can see more exmaple and usags in [docs](https://freesia.readthedocs.io/en/latest/?) and [examples](./examples).
Metadata
Release files for aysncfreesia 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aysncfreesia-0.0.2.tar.gz | 18.5 kB | Without provenance | Details |
Release files / aysncfreesia-0.0.2.tar.gz
| Download URL | aysncfreesia-0.0.2.tar.gz |
|---|---|
| Size | 18.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c76b7603f295f19c673f66a970cfe3e0dd3110f65738902a5570ae9d7ecd527
|
|
BLAKE2b-256 checksum How to use checksums |
91859ef377169e81c490a79840e4d533a5c9e0a9e3107168e2007ec640f99870
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.23.4 CPython/3.6.3
|
Security for aysncfreesia 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.