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[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)

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. 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.2.4

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.2.4
File Size Uploaded
netboot-0.2.4.tar.gz 111.1 kB Details

Built distribution (wheel)

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

Total release size: 182.7 kB

Release files / netboot-0.2.4.tar.gz

Download URL netboot-0.2.4.tar.gz
Size 111.1 kB
Tags Source
SHA-256 checksum
How to use checksums
588fd2f4dbc21cea72376bea1d2a5c573bd465fe72ef567a372bb65d4d8cf67c
BLAKE2b-256 checksum
How to use checksums
21ade4747aaa07da3976cf35cc6a09ef0b15f78c4b327b8377c41c664de7090a
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 Sep 28, 2026.

Transparency log

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

Download URL netboot-0.2.4-py3-none-any.whl
Size 71.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27cefb88e2d8ad98c391154363a076fd88e8beda2bbde6c1e110f725cc669696
BLAKE2b-256 checksum
How to use checksums
ed25705d17847032f1a845e7f609dad6a36088ca00c139ac722f1b8312bebdb8
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 Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

This release

0.2.4 This release

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