Skip to main content

nth python framework

Project description

Nextpress

A Python web framework inspired by Express.js, built on ASGI.

Installation

pip install nextpress

Quick Start

from nextpress import Nextpress, Request, Response, Anext

app = Nextpress()

async def logger(request: Request, response: Response, anext: Anext):
    print(f"{request.method} {request.path}")
    response.set_header("X-Processed-Time", str(time.time()))
    await anext()


async def hello(response: Response[str]):
    await response.send("Hello, World!")

app.get("/", logger, hello)

Run with:

uvicorn example:app

Features

  • Express-style routing with <method>() and use()
  • Route based middleware support with anext() pattern
  • Explicit response writing
  • Modular middlewares to parse input
  • Route matching and chaining
  • Built on uvicorn/ASGI for async performance
  • Response and Request generics for typing

Future features (feautures?)

  • Pydantic validation of request and response
  • CORS, multipart/form body parser, and other middlewares
  • Actual tests
  • Websocket handling

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

nextpress-0.1.0.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

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

nextpress-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file nextpress-0.1.0.tar.gz.

File metadata

  • Download URL: nextpress-0.1.0.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for nextpress-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2d79dcf9e7557193eb8e5f026e6d086ec816ab632b28d4802fa8090d7cd163e7
MD5 a3de0bece0781ff0495ce8613109dd75
BLAKE2b-256 552f54bb881c351c9389b9c58b7d5e57025fe022ac697544a5d92036bb2c6848

See more details on using hashes here.

File details

Details for the file nextpress-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nextpress-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for nextpress-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d7c7a343e76a2596ddbe537d20837d9a6b7b2c5a9c37078515f3de730456166
MD5 8f01b662a16c27f56e1faf460d343a14
BLAKE2b-256 87f1d6f9adb813c9070d370f153c8c02d30bd561b8198c805f9dec1535cc60c1

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