Skip to main content

Lightweight ASGI framework for building JSON APIs.

Project description

Pokit Stack

Stack is an experimental ASGI Python framework for building JSON APIs. It is in early development and is not suitable for production use. Any APIs exposed by this framework are subject to change without notice.

Installation

pip install pokit-stack

Example Program

example.py

import json

from pokit.stack import Stack
from pokit.stack.types import HTTPMethod, RequestContext


async def home(request: RequestContext) -> str:
    assert request.method == HTTPMethod.GET

    out = f"Hello World! You are on path: {request.path}, using the method: {request.method}"

    out += "\n\n==== Query Params ====\n\n"
    out += json.dumps(request.query, indent=4)

    out += "\n\n==== Request Headers ====\n\n"
    out += json.dumps(request.headers, indent=4)

    return out


app = Stack(handler=home)
uvicorn example:app

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

pokit_stack-0.0.0a3.tar.gz (30.5 kB view details)

Uploaded Source

Built Distribution

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

pokit_stack-0.0.0a3-py3-none-any.whl (30.9 kB view details)

Uploaded Python 3

File details

Details for the file pokit_stack-0.0.0a3.tar.gz.

File metadata

  • Download URL: pokit_stack-0.0.0a3.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pokit_stack-0.0.0a3.tar.gz
Algorithm Hash digest
SHA256 e1fb3573a8d56826ba334bda92ec021df6aa5c942e4efaeab5f486e02c3cd734
MD5 99a85aa7de49c2648d6b2986c42c7d1a
BLAKE2b-256 fbc6f38eab7b05396488dfb896d57f6a2f012b3da36f8798deabf63571342de7

See more details on using hashes here.

File details

Details for the file pokit_stack-0.0.0a3-py3-none-any.whl.

File metadata

  • Download URL: pokit_stack-0.0.0a3-py3-none-any.whl
  • Upload date:
  • Size: 30.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pokit_stack-0.0.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 7f009a48b0fab8d613be357269491412661934155e4404ba666b0794d6a70ea2
MD5 b1fa5d1c72fdbbe958fe4928f135ede5
BLAKE2b-256 6f313e9a14f3c6dd0358fd78ae5a668e8312004a13261db1efa0bb3682c8989f

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