Reference

Utils

webfluid.utils — the grab bag the framework leans on internally and exposes for your own use: small helpers, the log factory and the exception hierarchy.

webfluid.utils (framework helpers)

  • enabled(key) — read a truthy environment switch.
  • safe_string(text) / camel_to_snake(text) / random_code(length) — string helpers.
  • async_result(value) — await it if awaitable, otherwise return as-is.
  • safe_execute(fn, reraise, *args) — call sync/async, optionally swallowing and logging exceptions.
  • run_in_executor(fn, *args) — run a blocking call off the event loop.
  • required_arg_count(fn) / is_async_function(fn) — introspection used by the hook validators.
  • get_root_path(import_name), try_import(name) — import-location helpers.
  • check_required_version(requirement, ...), check_priority(priority), build_sorted_tuple(data) — version and config plumbing.
  • add_proxy(target, base_url, ...), get_proxy(...), get_websocket_proxy(...), close_proxy_client() — the reverse-proxy utilities behind HMR.

webfluid.utils.logging

The shared log factory:

example python
from webfluid.utils.logging import factory as log

log.log("info line")
log.debug("...")
log.warning("...")
log.error("...")
log.exception(exc, "optional message")
  • factory — the singleton LogFactory. Logs only while a run is in execution.
  • additive_context(fn) — routes a callable's logs through the Additive logger.
  • start_session() — sets up handlers and log level (called by the runtime).

webfluid.utils.additive

  • id_check, version_check, type_check — the manifest field validators.
  • require_extensions(*names) — decorator that asserts the named extensions are enabled.

webfluid.exceptions

  • FrameworkException — the root of all framework errors.
  • FrontendExceptionNodeError, TailwindError.
  • AdditiveExceptionManifestError.

That's a wrap

You've gone from a single main.py to the full surface of WebFluid. Keep the overview handy for the known issues this alpha ships with, pin your version, and go build something liquid.