Skip to main content

netboot

PyPI Python versions License: MIT Docs CI

PXE provisioning management: describe your netboot targets, images and DHCP zones in config, and let netboot render the per-target boot artifacts and arm (or disarm) DHCP for a machine as it enters and leaves the install process.

netboot is a small, hook-driven engine. A YAML config declares targets (host/MAC/IP), images (what to boot), dhcp zones (the network a target lives on) and content repos (where artifacts are fetched/served from). For a given target netboot builds a render context and produces netboot files from Jinja2 or shell-style templates, resolving names by MAC, hostname or IP with sensible fallbacks. Backends and behaviour are extensible through an event-hook system and pluggable DhcpServer handlers.

Install

pip install netboot            # the library
pip install netboot[config]    # ...plus what the `pixie` CLI needs to read a config
# or, from a checkout:
pip install .

Optional extras:

Extra Enables
netboot[config] YAML config loading for the CLI (pyyaml)
netboot[dns] The dnspython resolver backend (best coverage; without it hostname targets still resolve via the system/nslookup fallbacks)
netboot[http] http/https repository services (requests); file/tftp repos and rendering need nothing extra
netboot[kea] The kea:// DHCP backend (requests)
netboot[mako] *.mako templates (mako)
netboot[liquid] *.liquid templates (python-liquid)
netboot[handlebars] *.hbs / *.handlebars templates (pybars3)
netboot[mustache] *.mustache templates (chevron)
netboot[dhcpd] The dhcpd:// DHCP backend over OMAPI (pypureomapi)
netboot[winrm] windhcp:// over WinRM (pywinrm); over ssh it needs nothing
netboot[ssh] dnsmasq:// with remote sftp:// paths (pathlib_next[sftp])
netboot[docs] Build the documentation site (mkdocs)

*.erb and *.epp templates need no extra, but do need ruby or puppet installed: they render through the real program, so an existing template behaves as its author tested it. PIXIE_RUBY / PIXIE_PUPPET name it when it is not on PATH. Jinja2 (.j2) and the %{NAME} shell engine (.shtpl) are built in, and a file no engine claims is copied unchanged.

Built on duho (CLI/args/command discovery), pathlib_next (URI-aware paths), yaconfiglib (layered YAML), and Jinja2. IP/MAC/DNS helpers come from netimps, re-exported as netboot.utils.net.

CLI

The command is pixie (PXE is pronounced "pixie"); netboot is the library package it drives.

# Initiate the PXE process for a target (render artifacts + arm DHCP):
pixie initiate my-host

# Complete it (post-boot cleanup, disarm DHCP):
pixie complete my-host

Global options:

Option Purpose
-c, --config PATH Explicit config file (yaml/cfg)
--baseconfig DIR Base config directory to search (default ./config)
-l, --load-module M Import module(s) before building netboot (config/hook deps)
--cmdspath PATH Extra directories/packages to search for commands

A target is looked up by exact id, or by hostname prefix / MAC / IP.

Library

from netboot import Pixie

pixie = Pixie(**config)                  # config: the merged YAML mapping
target = pixie.lookup_target("my-host")
ctx = pixie.make_context(target)         # render context (image + dhcpzone + target)
print(ctx.render("boot.ipxe.j2"))        # render a template against the context
pixie.initialize(target)                 # arm DHCP for the target
pixie.complete(target)                   # cleanup once installed

Extending

  • Hooks. Pass hooks=[...] (callables or "module.func" import strings) to Pixie(...). Each hook f(event, netboot, value, kwargs) -> value is called for every PixieEvent and may transform the value flowing through it — used to customise lookup, context construction and the init/complete lifecycle.
  • DHCP backends. netboot ships four — dnsmasq://, kea://, dhcpd:// and windhcp:// (Windows, over ssh or WinRM) — each imported only when a config names its scheme. Write your own by subclassing netboot.dhcp.DhcpServer: the lowercased class name is the URI scheme it handles, and --load-module registers it before the config builds the zones. What the server should tell the client rides in the URI query; see the configuration guide.

A complete runnable setup — config, both template engines and a DHCP plugin — is in examples/.

Development

python -m venv .venv/3.14
.venv/3.14/bin/pip install -e ".[dev,docs,config,http]"   # Scripts/ on Windows
.venv/3.14/bin/python -m pytest -q -rs                    # the suite
.venv/3.14/bin/python -m black src tests benchmarks       # formatter
.venv/3.14/bin/python -m mkdocs build --strict            # docs

Install every extra that has tests — without http the repository-service tests skip instead of running, which -rs makes visible (dev carries the template engines' libraries for the same reason; the .erb/.epp tests skip unless ruby/puppet are installed). Develop on the latest Python and also run the floor (3.9) before finishing a piece of work. More detail, plus the layout and CI notes, in AGENTS.md.

Releasing

Tags and CHANGELOG.md use SemVer; pyproject.toml uses PEP 440. Pre-1.0 the minor slot is reserved for breaking the documented API — additions and fixes are patches. Pushing a v* tag runs test → build → GitHub release → PyPI and then deploys the docs for that tag; the release body is scraped from the matching ## [x.y.z] changelog section.

License

MIT — see LICENSE.

Metadata

Release files for netboot 0.3.2

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

Source distribution (sdist)

Source distribution for netboot 0.3.2
File Size Uploaded
netboot-0.3.2.tar.gz 189.0 kB Details

Built distribution (wheel)

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

Total release size: 308.1 kB

Release files / netboot-0.3.2.tar.gz

Download URL netboot-0.3.2.tar.gz
Size 189.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9d5894a8a49191ce85617214725f98f1a5570f57a066ed7a2953fb926addabff
BLAKE2b-256 checksum
How to use checksums
3da20d7d7b14df6b76d022ea37b23d0c5f5fc468cf75a11157c37b711b9428ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release files / netboot-0.3.2-py3-none-any.whl

Download URL netboot-0.3.2-py3-none-any.whl
Size 119.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56a9367f912f78f457968cce5beefd2d6e4e2495c475fdad947544990292dbb8
BLAKE2b-256 checksum
How to use checksums
adfb02b7100f42d26daf904319af9edb505e4f6ff2016558017d8a4135e01d96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

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