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.0a1.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.0a1-py3-none-any.whl (30.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pokit_stack-0.0.0a1.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.0a1.tar.gz
Algorithm Hash digest
SHA256 3e085f4b1a8310c10a37588106aa0ee5c26dbf1dcd44cf25be916bf812f0bc89
MD5 2459cb27edbd0023e9a29378cd6050c0
BLAKE2b-256 02e0045277621cf2ee830880e22641341686c0ff74d74b26d829b7ad0e314a46

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pokit_stack-0.0.0a1-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.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e3d8e853455b5afb7bdd51d1c59fe873906659390e10f75dc2910a6b5577125
MD5 8c359f8684b2ff468304529edbd64ab5
BLAKE2b-256 1e43212bc8f0688accf38fe6d81e10b43505ab336378315584ff27e58e2d7874

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