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.0a4.tar.gz (31.2 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.0a4-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pokit_stack-0.0.0a4.tar.gz
  • Upload date:
  • Size: 31.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pokit_stack-0.0.0a4.tar.gz
Algorithm Hash digest
SHA256 26f060deaab56bce52411e1f3c4875b345424c65ed606f95fc6d3d30f1bdd8c0
MD5 f0745ad66c3dc958abd91d69b529fdb5
BLAKE2b-256 79280cc4247ac1901df331e97782bbaf452c1f8501a5ca9e6855b92a31b34f54

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pokit_stack-0.0.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 61d448748033fdac4929bd90e4843b06d4d031902e3a0db6995256d76d3a4757
MD5 c7c00746e8e72c641b47843bab5e171c
BLAKE2b-256 34d0d28e7f607c682d589ec252f1fbf84e34ed26302b10de563981e61d0d49a3

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