Skip to main content

nctab

Terminal NC/G-code editor and toolkit for CNC programmers.

CI PyPI PyPI Downloads Python License: MIT uv Ruff

nctab demo

Features

  • TUI editor with a tool-section outline, file browser, live word/modal-state inspector, find & replace with preview, bookmarks, snippets and a command palette.
  • Safe by default — every transform prints a diff and writes nothing unless you pass -i / -o. Writes are atomic; --backup keeps a .bak.
  • Exact arithmetic — Decimal throughout; untouched lines round-trip byte for byte.
  • Transforms — renumber, strip, case, shift, scale, mirror, rotate, address math, feed/speed scaling, limited to a line, block or tool range.
  • Analysis — stats, tool list, 21 validation rules, NC-aware diff.
  • Machine profiles for Fanuc (mill/turn), Haas, Siemens ISO and generic ISO, plus your own TOML profiles.
  • CI-friendly — versioned --json output and meaningful exit codes.

Installation

Requires Python 3.13+.

uv tool install nctab      # or: pipx install nctab
# one-off, without installing:
uvx nctab --help

Optional DNC/serial support: uv tool install "nctab[dnc]".

Quick start

nctab part.nc                              # open the editor
nctab stats part.nc                        # summary: axes, codes, tools, feeds
nctab check part.nc --strict               # validate; non-zero exit on problems
nctab shift part.nc --z -0.02              # preview the change as a diff
nctab shift part.nc --z -0.02 -o part_z.nc # write it
nctab diff --ignore-n old.nc new.nc        # compare ignoring block numbers

Documentation

Guide Contents
Editor Layout, key bindings, find & replace
CLI reference All commands, ranges, JSON output, exit codes
Configuration Config layers, machine profiles, snippets
Architecture Package layout and design rules
Development Setup, testing, releasing

Contributing

Contributions are welcome — please read CONTRIBUTING.md and the Code of Conduct. Security issues: see SECURITY.md. Changes are tracked in CHANGELOG.md.

License

MIT © 0ndrec

Metadata

Release files for nctab 0.2.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 nctab 0.2.0
File Size Uploaded
nctab-0.2.0.tar.gz 78.0 kB Details

Built distribution (wheel)

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

Total release size: 186.2 kB

Release files / nctab-0.2.0.tar.gz

Download URL nctab-0.2.0.tar.gz
Size 78.0 kB
Tags Source
SHA-256 checksum
How to use checksums
87e1cf3e4cc390b7579a8b8ccb5b26a196a6d5552e5cc02f74441462ee454cf8
BLAKE2b-256 checksum
How to use checksums
ff930fd4039c121fa8a8af6c0436a627a3f13437fef4d47b95932157fd566a42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / nctab-0.2.0-py3-none-any.whl

Download URL nctab-0.2.0-py3-none-any.whl
Size 108.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd3af9817e722dd85b323e928fc01ddee99867b2690000b786c43dc3a9307059
BLAKE2b-256 checksum
How to use checksums
cc85750c9ced86ed79dcedb9b8c14425d2eef1f8c0d5c902f9b2cf29fbf78656
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.2

2 release files

0.1.1

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