Skip to main content
uniac.Service is the base class for kind=lib packages — reusable building blocks consumed by other Services or Systems. It is a pure marker subclass of NodeSpec: no __init__, no methods to override.
from uniac import Service

Declaring a Service

Subclass Service and declare any Node dependencies as class-level annotations. If you take init args, provide your own __init__.
from uniac import Service
from db import Db  # generated Node stub

class Cache(Service):
    db: Db

    def __init__(self, ttl_seconds: int = 60):
        self.db = Db()
        self.ttl_seconds = ttl_seconds
uniac build publishes this Service to the local store. Other packages list its name under dependencies in uniac.json, run uniac install, and import a generated Cache Node stub.

What Service provides

  • _uniac_validate() — inherited from NodeSpec.
  • _uniac_walk() — inherited from NodeSpec.
There is no base-class __init__ to call. The framework never auto-instantiates Nodes; you do. For deployable packages, use System instead.