Assemble software, don't write it.

open-sourceApache-2.0python3.12+

Assemble software that is distributed, persistent, reactive, reload-proof, inspectable.

50x less code for humans, 50x less tokens for agents than writing it line by line in imperative Python.

statekv storage
class Counter(nu.Shape):
val: nu.v.IntRef
uirefs as widgets
class Dashboard(nu.ui.Page):
count: nu.ui.TextRef
apptwo flows in parallel
app = nu.Parallel(
tickloop forever
nu.ForeverDo(
incadd 1 to state
Counter.val.inc()
>>
waitdelay 1 second
nu.Delay(1.0)
)
livewake on change
nu.ReactForever(
subscribewhich ref
Counter.val.on_change(),
bindupdate ui state
Dashboard.count.set(Counter.val)
)
nu://dashboarddashboard42dashboard.countval = 42kv storagepersisted · survives restart

We build on the Interaction Model

Nu
the one core atom
Ref
address to any resource
Interaction
the work over refs
Query
pure evaluation, yields values
Command
mutation, yields nothing
Action
mutation, yields values
Span
scope wrapping a body
Flow
orchestration of mutations
Nu
the one core atom
Ref
address to any resource
Interaction
the work over refs
  • Query
    pure evaluation, yields values
  • Command
    mutation, yields nothing
  • Action
    mutation, yields values
  • Span
    scope wrapping a body
  • Flow
    orchestration of mutations

Nu - the interaction model made real in Python.

Nu ships the model in pure Python. Batteries included: fabrics for the everyday jobs - in-memory state, kv-based state, Ray-distributed compute, UI building.

persistent_counter_ui.py
python · 32 locpy
import nu
class Counter(nu.Shape):
value: nu.v.IntRef
class Dashboard(nu.ui.Page):
count: nu.ui.TextRef
class App(nu.ui.Index):
pages = nu.ui.Pages({"/": Dashboard})
app = nu.With(
nu.v.presets.rocksdb_navigator(".dbtest"),
nu.ui.presets.server(
nu.v.auto_flow_atomic(
nu.ReactForever(
Counter.value.on_change(),
Dashboard.count.set(Counter.value),
),
),
),
body=(
nu.IfDo(Counter.value.missing(), Counter.value.store(0))
>> nu.ForeverDo(
Counter.value.inc() >> nu.Delay(1.0),
)
),
)
if __name__ == '__main__':
import asyncio
asyncio.run(nu.arun(nu.v.auto_flow_atomic(app)))

The current fabrics.

Here are the native ones Nu speaks today.

  1. nu.mem

    In-process substrate.

    Ephemeral Python-native store. Zero-config default for tests, notebooks, cache, etc.

  2. nu.virtuals

    Persistent substrate for Nu.

    Virtual collections over any key-value storage. One protocol, swappable backends.

    • rocksdb
    • lmdb
  3. nu.ray

    Compute across the cluster.

    Scale Nu with Ray. Distribute work without leaving the interaction model.

  4. nu.ui

    Refs on screen.

    A rendering fabric that binds Nu Refs to live UI surfaces.

  5. nu.invisibles

    Location-independent Nus.

    Transparent RPC across processes and machines. Run Nus wherever you want.

Standalone apps built on Nu.

Applications built on Nu today.

  1. nulog

    Logging built on Nu.

    Structured logs as first-class Refs. Handles billions of entries without breaking a sweat. UI dashboard out of the box.

  2. nuspace

    A workspace for building on Nu.

    The Nu programming model scaled into a knowledge base. Your everything base.