General purpose server framework in Python
Project description
bamboo
Supported Interfaces
- WSGI
- ASGI v3.0 (HTTP, WebSocket and Lifespan)
Installing
- Python: >= 3.7
python -m pip install bamboo-core
Usage
以下は簡単な実装例です.
from bamboo import WSGIApp, WSGIEndpoint, WSGITestExecutor
app = WSGIApp()
@app.route("hello")
class MockEndpoint(WSGIEndpoint):
def do_GET(self) -> None:
self.send_body(b"Hello, World!")
if __name__ == "__main__":
WSGITestExecutor.debug(app)
上記スクリプトを実行後,ブラウザで http://localhost:8000/hello にアクセスするとレスポンスを確認できます.
API documentation
API ドキュメントはこちら.
Examples
upsidedown
リクエストされた文字列を逆順に反転させて返すアプリケーションです.
image_traffic
アクセスに対して静的な画像を返すアプリケーションです.
tweets
CLI ベースの簡易的な Twitter のような投稿アプリです.認証機能は実装されていません.
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
bamboo-core-0.10.5.tar.gz
(48.7 kB
view hashes)
Built Distribution
Close
Hashes for bamboo_core-0.10.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77beb129af6b36156e84c976aeb5b1a662709906aaf213dbc731b22d6ef03ccb |
|
MD5 | 85f4317e4437515dfe493c4ba0cafad1 |
|
BLAKE2b-256 | 2c3ebe3e75a77c422d4a762dd39df044e570596bdf035bd4076871ea8b7b817b |