Skip to main content

pythonboot-web

PythonBoot 的独立 Web 实现包,包含 Controller、路由、异常处理、请求与响应上下文、 日期格式化、API 文档、ASGI 生命周期和 Web 启动类。

依赖 pythonboot、FastAPI 和 Uvicorn,用户推荐安装 pythonboot-starter-web。 核心接口从 pythonboot 导入,Web 接口从 pythonboot_web 导入。 原来的 pythonboot.web 和核心包顶层 Web 导出已移除。 YAML 的 pythonboot.web 配置键保持不变。

from pythonboot import autowired, service
from pythonboot_web import PythonBootApplication, controller, get, pythonboot_application

@service
class GreetingService:
    def greeting(self) -> str:
        return "Hello"

@controller(prefix="/greeting")
class GreetingController:
    service: GreetingService = autowired()

    @get("")
    def greeting(self) -> str:
        return self.service.greeting()

@pythonboot_application(scan_packages=("myapp",))
class Application(PythonBootApplication):
    pass

完整分层应用见 全量 Starter 示例,包含全部 Starter、PostgreSQL/Redis 和同步/异步 HTTP 用法。 See the complete Starter application for all Starters and sync/async HTTP examples.

Metadata

Release files for pythonboot-web 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pythonboot-web 0.1.0
File Size Uploaded
pythonboot_web-0.1.0.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pythonboot-web 0.1.0
File Interpreter ABI Platform
pythonboot_web-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.5 kB

Release files / pythonboot_web-0.1.0.tar.gz

Download URL pythonboot_web-0.1.0.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
359fee4754b031c7fc3bdcf7b8b696e121ff15699d39a948d21d7250fca6e659
BLAKE2b-256 checksum
How to use checksums
621772320e27bc7154588a4058cd57905547759dc5bc7b26de32e9701ef37853
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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}

Release files / pythonboot_web-0.1.0-py3-none-any.whl

Download URL pythonboot_web-0.1.0-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86eea3009767ebb9fb20c08755e416f345087617caa7a4c2704da14055289c74
BLAKE2b-256 checksum
How to use checksums
86227a997f82b81b595f49882ec16802a72c40149c081e4c866df493cc0329f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page