Skip to main content

ndnc

A DSL interpreter for transparent distributed execution over NDN (Named Data Networking).

Write code without thinking about where it runs — local or remote. The system handles it.

Installation

pip install ndnc

Usage

Run a .ndn script

ndnc run path/to/script.ndn

Run with arguments

ndnc run path/to/script.ndn arg0 arg1

Start NDN server (producer)

ndnc serve

Examples

Fetch data by NDN name and print it:

let height = interest "/height/Mt.Fuji/"
print height

Fetch data and convert units with a local function:

let height_m = interest "/height/Mt.Fuji/"
let height_ft = m_to_feet(height_m)
print height_ft

These examples use locally registered data and run without NFD. When NFD and NLSR are running, interest first checks local data, and if not found, fetches it over the NDN network transparently.

Requirements

NDN Network Requirements

To fetch data or execute functions over an actual NDN network, the following must be running on your machine:

  • NFD (NDN Forwarding Daemon) — handles NDN packet forwarding
  • NLSR (Named-data Link State Routing) — manages routing between NDN nodes

Without these, interest expressions will fall back to local data only.

Function return values

Use return to produce a function result. It stops execution of the current script/function. print writes to stdout only and is never used as the result. Without a return, the result is None (an empty response over the text NDN/gRPC interface).

Function (average.ndn):

let avg = (arg0 + arg1) / 2
return avg

Caller:

let result = average(10, 20)
print result

For CLI integrations, keep logs on stdout and write the return value separately:

ndnc run --result-file result.json average.ndn 10 20

result.json contains JSON 15. ndnc run does not automatically print return values. This also applies to cached function execution and exec_in_context. Existing function scripts that used print as their return value must change to return. Caller scripts that print results remain unchanged.

Release: the existing release-branch workflow increments the package version from 0.0.6 to 0.0.7. Publish that version before building the function runtime and invoker images pinned to 0.0.7; deploy both images before registering scripts using return. Source-cache entries from before the migration may remain until their TTL expires (300 seconds).

Metadata

Release files for ndnc 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ndnc 0.0.7
File Size Uploaded
ndnc-0.0.7.tar.gz 12.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ndnc 0.0.7
File Interpreter ABI Platform
ndnc-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 24.6 kB

Release files / ndnc-0.0.7.tar.gz

Download URL ndnc-0.0.7.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
441177f66038cfd0558172dabec1a04e056bc599cf17a645f10df8a8c5e5f657
BLAKE2b-256 checksum
How to use checksums
45bedc07ed28e74c06c3653a9dffcffa34fea774db32b450d6470da52073ed8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / ndnc-0.0.7-py3-none-any.whl

Download URL ndnc-0.0.7-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
91c7f12377d413168be704a151e8e62f047d34d19918a746b5a9219307d83616
BLAKE2b-256 checksum
How to use checksums
31ac4acafb85c1de11027c9b4c64b856d54a459e27eaacded8b5e8376079734a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page