netboot
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) toPixie(...). Each hookf(event, netboot, value, kwargs) -> valueis called for everyPixieEventand 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://andwindhcp://(Windows, over ssh or WinRM) — each imported only when a config names its scheme. Write your own by subclassingnetboot.dhcp.DhcpServer: the lowercased class name is the URI scheme it handles, and--load-moduleregisters 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.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| netboot-0.2.3.tar.gz | 110.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| netboot-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 182.5 kB
Release files / netboot-0.2.3.tar.gz
| Download URL | netboot-0.2.3.tar.gz |
|---|---|
| Size | 110.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
871d617dcd05315bc8f9a39e53849e9aef16abea60e72707936bbccc2216a354
|
|
BLAKE2b-256 checksum How to use checksums |
bbb4c7c2325b24f797785b62250fc6334b3496e48d82e72a0a45f408b5983714
|
| 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 23, 2026.
Transparency logRelease files / netboot-0.2.3-py3-none-any.whl
| Download URL | netboot-0.2.3-py3-none-any.whl |
|---|---|
| Size | 71.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ee385b8ee280b6f25262c932c8ba07095412bcad7a53f587f5e06538c009158
|
|
BLAKE2b-256 checksum How to use checksums |
359a9767c8c23f4fcf48d68f5e4efb5f46b3f6c890ee6d65af2c944a4aa23407
|
| 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 23, 2026.
Transparency log