httk.serve.web¶
Submodules¶
- httk.serve.web.api
- httk.serve.web.cli
- httk.serve.web.compat
- httk.serve.web.engine
- httk.serve.web.functions
- httk.serve.web.model
- httk.serve.web.providers
- httk.serve.web.publishing
- httk.serve.web.renderers
- httk.serve.web.resources
- httk.serve.web.runtime
- httk.serve.web.templating
- httk.serve.web.widgets
Attributes¶
Stable |
Classes¶
The immutable, site-local context passed to a table provider. |
|
A table column and its small, presentation-only metadata. |
|
One provider-owned page of structured rows and opaque navigation cursors. |
|
The bounded page request passed to |
|
Callbacks owned by one |
Functions¶
|
|
|
|
|
Package Contents¶
- httk.serve.web.create_asgi_app(srcdir: str | pathlib.Path, *, baseurl: str | None = None, compatibility_mode: bool = False, config_name: str = 'config', debug: bool = False, table_token_secret: str | bytes | None = None) starlette.applications.Starlette[source]¶
- httk.serve.web.publish(srcdir: str | pathlib.Path, outdir: str | pathlib.Path, baseurl: str, *, host_static: str | None = None, compatibility_mode: bool = False, config_name: str = 'config', use_urls_without_ext: bool | None = None) httk.serve.web.model.page.PublishReport[source]¶
- httk.serve.web.serve(srcdir: str | pathlib.Path, *, host: str = '127.0.0.1', port: int = 8080, baseurl: str | None = None, compatibility_mode: bool = False, config_name: str = 'config', debug: bool = False, table_token_secret: str | bytes | None = None) None[source]¶
- class httk.serve.web.ProviderContext[source]¶
The immutable, site-local context passed to a table provider.
- query: collections.abc.Mapping[str, str]¶
- page: collections.abc.Mapping[str, object]¶
- global_data: collections.abc.Mapping[str, object]¶
- class httk.serve.web.TablePage[source]¶
One provider-owned page of structured rows and opaque navigation cursors.
- rows: tuple[collections.abc.Mapping[str, object], Ellipsis]¶
- columns: tuple[TableColumn, Ellipsis]¶
- classmethod from_rows(rows: collections.abc.Iterable[collections.abc.Mapping[str, object]], *, columns: collections.abc.Iterable[TableColumn | str | collections.abc.Mapping[str, object]], next_cursor: str | None = None, previous_cursor: str | None = None, total: int | None = None, revision: str | None = None) Self[source]¶
Construct a page while adapting compact column declarations.
- class httk.serve.web.TableRequest[source]¶
The bounded page request passed to
provide(context, request, ...).
- httk.serve.web.SITE_RESOURCES_KEY = 'httk_serve_resources'[source]¶
Stable
global_datakey through which site startup code gets resources.
- class httk.serve.web.SiteResources[source]¶
Callbacks owned by one
httk.serve.web.engine.site_engine.SiteEngine.Site
functions/init.pycode can obtain this object fromglobal_data[SITE_RESOURCES_KEY]and callregister()for every persistent resource it opens. Callbacks run in reverse registration order when thehttk.serve.web.engine.site_engine.SiteEnginecloses. Closing is idempotent, so ASGI lifespan shutdown and an enclosing helper may both safely close the same engine.- register(callback: CleanupCallback) None[source]¶
Register one synchronous callback to run during
close().Registration after close is a programming error: the callback could no longer be guaranteed to run.