Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pythonappscript-0.2.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pythonappscript-0.2.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file pythonappscript-0.2.0.tar.gz.

File metadata

  • Download URL: pythonappscript-0.2.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

Hashes for pythonappscript-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5684963a2124e00442994a733ffb0c87873823ee498471641527c829b76f68e4
MD5 fcbd465b2b6d126c629aa5aa59b7b15a
BLAKE2b-256 1cc25d8022b00c7f6bdbc94d04f6b70a9a63e892073cd6d837fa1fc20863bb5d

See more details on using hashes here.

File details

Details for the file pythonappscript-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pythonappscript-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89c25422cab6e38110aa149b3c61ec01854d0fe9e5fe4ebbecf058b3d17d448b
MD5 fb41f350d77c4d4c9cfc6b51146f25f8
BLAKE2b-256 c38dfbfb8a8cd3af6383cb1b7384c81d959deb9d28e66b9f61eacfaaa2f2c96d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page