Skip to main content

nkparser

nkparser parses, queries, validates, and round-trips Foundry Nuke .nk script files.

Install

This project is managed with uv.

uv sync

Install the package into the current environment:

uv pip install .

Install with Graphviz rendering support:

uv pip install '.[graphviz]'

CLI

The package exposes two console scripts:

uv run nkparser --help
uv run nkparse --help

You can also run it as a module:

uv run python -m nkparser --help

Examples

uv run nkparser info tests/fixtures/minimal.nk
uv run nkparser validate tests/fixtures/malformed_unclosed.nk
uv run nkparser tree tests/fixtures/complex_groups.nk --knobs
uv run nkparser nodes tests/fixtures/minimal.nk --class Grade
uv run nkparser dot tests/fixtures/minimal.nk -o graph.dot
uv run nkparser dot tests/fixtures/minimal.nk -o graph.dot --render --dot-command /opt/homebrew/bin/dot

Development

Sync the dev environment:

uv sync --dev

Run checks:

uv run pytest
uv run ruff check .
uv run mypy

Build distributions:

uv build

Python API

import nkparser

script = nkparser.Script.from_file("comp.nk")

print(script.nuke_version)
print(len(list(script.all_nodes())))

reads = script.query().of_class("Read").all()
grade = script.find("Grade1")

if grade:
    grade.set("disable", "true")

script.write("comp_modified.nk")

Metadata

Release files for nkparser 0.3.0

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

Source distribution (sdist)

Source distribution for nkparser 0.3.0
File Size Uploaded
nkparser-0.3.0.tar.gz 886.2 kB Details

Built distribution (wheel)

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

Total release size: 916.1 kB

Release files / nkparser-0.3.0.tar.gz

Download URL nkparser-0.3.0.tar.gz
Size 886.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3d0d40d652bd6b572973b36ca366ed8283d05824eab731d48ac671660a337e96
BLAKE2b-256 checksum
How to use checksums
a34392ccb45786448a3f3ea080aed18b92fd7fe279de22f05eb9b7b4459ac59f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / nkparser-0.3.0-py3-none-any.whl

Download URL nkparser-0.3.0-py3-none-any.whl
Size 30.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e20fd0d9b35da4cf57108a96cb40ca14395e6a950bab828b19070e04b4eb444e
BLAKE2b-256 checksum
How to use checksums
0dec5d9a6ee42dc242b487dae25510c6632d2834577e7cc093f7e12c467c515f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

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