Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.1.6 instead.

Nu

The interaction primitive.

Build apps in one primitive that spans your whole stack (databases, UIs, AI agents, and services). No glue. 50x less code.

Every app is a set of interactions between systems: a database, a UI, AI agents, and services. Nu makes interaction the primitive:

  • Ref names what you touch. A KV slot, a UI widget, an LLM endpoint, a memory slot, a remote object.
  • Interaction describes what to do with it. Read, write, branch, iterate, compose.
  • Fabric binds Refs to a real backend. Swap the Fabric, keep the tree.

Persistence, reactivity, atomicity, observability, and scalability are inherent, not bolted on.

The interaction model

Nu, the one core atom, splits into two:

  • Ref: address to any resource.
  • Interaction: the work over Refs.

Interaction has five kinds:

  • Query: pure evaluation, yields values.
  • Command: mutation, yields nothing.
  • Action: mutation, yields values.
  • Span: scope wrapping a body.
  • Flow: orchestration of mutations.

Compose them into a tree. That is a Nu program.

Example

A dashboard on a live counter that persists across restarts. One Nu tree, two Fabrics.

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.set(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)))

Run it, open the browser tab. The counter ticks once a second, the dashboard mirrors it live. Kill it, run again, it picks up where it left off.

More examples in examples/. Full walkthrough at nustack.dev/docs.

Fabrics

A Fabric implements Refs against one backend. Nu ships five in-tree.

Fabric What
nu.m In-process substrate. Zero-config default for tests, notebooks, cache.
nu.v Persistent substrate backed by virtuals. Virtual Python collections over RocksDB, LMDB, more.
nu.ui Refs on screen. Binds Nu Refs to a live browser tab.
nu.invisibles Location-independent Nus. Transparent RPC across processes and machines.
nu.ray Compute across the cluster. Scale Nu on Ray without leaving the model.

Swap the Fabric, keep the tree. Same program runs against different substrates.

Install

From source. Python 3.12+. See nustack.dev/docs/how-to/install for the full guide (Python side, UI bundle, verify).

Apps built on Nu

  • nulog. Structured logging as a Nu app. Handles billions of entries, UI dashboard out of the box.

Status

v0.1.0. APIs will break, no backwards compatibility guarantees.

License

Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nustack_py-0.1.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nustack_py-0.1.0-py3-none-any.whl (426.9 kB view details)

Uploaded Python 3

File details

Details for the file nustack_py-0.1.0.tar.gz.

File metadata

  • Download URL: nustack_py-0.1.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nustack_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b76ea030622a56f52e49cf88b9af9b6fe5f4f1b0cbb48965d0949ec64e2cb07a
MD5 e9788d583fba3ce5853939c84fcb5188
BLAKE2b-256 d1fd410b3a5042ac536eb1987823accddc51618e1a4096569d2ba18f6a63d404

See more details on using hashes here.

Provenance

The following attestation bundles were made for nustack_py-0.1.0.tar.gz:

Publisher: publish-nu.yml on nustackdev/nu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nustack_py-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nustack_py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 426.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nustack_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07e2f26e0c0242efd09b8a0c75222b5a74f7c5f86a9146c7e2ccb83bf275be90
MD5 40149dcddf3b3f16081528a6f410d5fd
BLAKE2b-256 3b9f82aaeb2cb32365a80d2794ef53ae6c26318a16997307f4fac274dbb40b79

See more details on using hashes here.

Provenance

The following attestation bundles were made for nustack_py-0.1.0-py3-none-any.whl:

Publisher: publish-nu.yml on nustackdev/nu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page