General purpose server framework in Python
Project description
Bamboo
Installling
- Python: >= 3.8
$ 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.6.2.tar.gz
(46.5 kB
view hashes)
Built Distribution
Close
Hashes for bamboo_core-0.6.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f88b9d88f7a7b5b13eb0f3a4bc2c251089eb49cf8bb5b3331732a2fa072424a |
|
MD5 | 3f7f26b4868ac6a144c1f407a3d9a79f |
|
BLAKE2b-256 | 46031513c5836f6a57e145c24a5f4bfe65bbf908f12cb232fa18489a3331c132 |