Reference

Additives

The module system: the Additive class, its router, the manifest and the registry helpers that discover and load Additives at startup.

Additive

from webfluid import Additive — a self-contained sub-app. Must live inside the additives package and expose itself as additive.

  • Additive(import_name, base=None, required_extensions=None) — constructs it from its manifest; pass a base to extend it.
  • api, app, ws — the JSON / HTML / WebSocket routers, mounted under the Additive's prefix.
  • render(template, **ctx) — render within the Additive's template namespace.
  • before_enable(fn) / after_enable(fn) — enable-time hooks (the place to register routes).
  • before_request(fn) / after_request(fn) / context_processor(fn) — scoped request hooks.
  • enable(fluid), install(), configure(config) — lifecycle, file/package extraction, and interactive app-config contribution.
  • unique_name(name), version, id, prefix, is_base, manifest — identity and metadata.

AdditiveRouter

  • An APIRouter variant used by the three Additive routers.
  • http_middleware(fn) — wrap every route of the router with request middleware.

AdditiveVersion

  • from webfluid import AdditiveVersion — a comparable (major, minor, patch) tuple with a trimming length property and a v1.2 style string.

Manifest

from webfluid import Manifest — the parsed manifest.json.

  • Required fields: id, version, type (base / default), frontend. Optional: name, description, authors, requires.
  • check_requirements(additive_root) — validates the framework version, required Additives and packages.
  • Dict-like access: manifest["id"], get, keys, items, ...

webfluid.additives.core

  • register_additives(fluid) — the startup hook that discovers, enables and wires every switched-on Additive.
  • installed_additives(package) / installed_bases(package) — list discovered default / base Additives.
  • import_base(base_id) — resolve an installed base Additive by id (used when extending).

Continue reading

From here you can continue straight with Utils.