Lightweight ASGI/WSGI web framework
Project description
pyappscript
pyappscriptはオープンソースで開発を助けます。本体
pyappscriptは簡単にアプリケーションを作成可能で、jinjaを搭載しています。:)
アプリケーションの作成
import pas
@pas.get
def getpage(e):
if e.path == "": #mainpage
return "helloWorld"
return "pyappscript :D"
pas.run(8000)
このようになります。
Pyappscriptの特性として、ルーティングは自分で行う点があります。 flaskのような便利なフレームワークに存在するようなroute関数が存在しないのです。 これは一見デメリットのように感じますが、一つ一つが結びつくのではなく、集合となって結びつくと考えられるのです。
たとえば、flaskで行われる以下のようなものが必要ないのです。
@route("/user/<userid>")
これは明らかな柔軟性をもたらします。
またこれらはシンプルであるため、自分でhttpの仕組みを考えることができるのです。
methodの解説
@pas.getのようにhttpの処理を行うデコレータが4つ存在します。 それは以下の通りです。
- get
- post
- put
- delete
これらが存在することにより、すべてのことが可能になります。 これらのデコレータは「リクエストオブジェクト」を返り値として渡します・
リクエストオブジェクトは、method,path,ip address,ua,host,cookie,header,パラメータ(data) post(formで返されるもの),item(セッション)を返します。
セッションは自動で作成されます。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pythonappscript-0.1.0.tar.gz.
File metadata
- Download URL: pythonappscript-0.1.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c1553b9fd90eb0bc43e8be58a70b87ec3bede3e49bfb95d7042f00337ad5397
|
|
| MD5 |
807a3ed803728696f32c2754a69e1b3b
|
|
| BLAKE2b-256 |
f6f936173b870c08a81486c077f9f74a16c9b4827bc74a1ed0928a689c6fe330
|
File details
Details for the file pythonappscript-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pythonappscript-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f07efd09b5bd05b9ce3a1d89533db34b646cde48840730133ef3884ba7b49fe5
|
|
| MD5 |
697bd111749261821817fadc09529889
|
|
| BLAKE2b-256 |
0dc222caf9e1ceb9dcf67aa9624359b5232c8a33fda57787d401ba190994ab8b
|