altium-monkey
▓▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓▓▓▓░░░░░░▓▓░░░░░░▓▓▓▓
░░░░▓▓░░░░░░░░░░░░░░░░░░▓▓░░░░
░░░░▓▓░░ ░░░░░░ ░░▓▓░░░░
░░▓▓░░██ ░░░░░░██ ░░▓▓░░
▓▓░░░░░░░░░░░░░░░░░░▓▓
▓▓░░░░░░░░░░░░░░▓▓
▓▓▓▓░░░░░░▓▓▓▓
▓▓▓▓▓▓ ░░
▓▓▓▓▓▓▓▓▓▓ ▓▓
▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓▓▓▓░░▓▓░░▓▓▓▓
altium-monkey is a Python toolkit for reading, writing, analyzing, and
rendering Altium files directly from automation.
It is designed for engineers who want to build their own command-line tools, CI/CD checks, visualization pipelines, library generators, BOM workflows, and design-review helpers without driving the Altium GUI for every operation.
What It Supports
Core file types:
.SchDoc.SchLib.PcbDoc.PcbLib.PrjPcb.OutJob.IntLibextraction.PCBDwfDraftsman files, currently experimental
Common workflows:
- create and mutate schematic documents
- create schematic symbols and PCB footprints
- insert SchLib symbols and PcbLib footprints
- extract SchLib and PcbLib data from projects
- render logical schematic SVGs, compiled physical schematic SVGs, and PCB SVGs
- inspect PCB layers, drills, board outlines, nets, and net classes
- author and mutate PCB vias, including IPC-4761 protection metadata
- extract embedded fonts and 3D models
- generate project containers and, on Windows with Altium Designer installed, run associated OutJobs within the limitations below
- create experimental Draftsman pages with notes, text, pictures, and generated board-assembly-view highlight artwork
Known OutJob Automation Limitation
prj.outjob().run(...) drives Altium Designer through its scripting API. It is
a best-effort Windows integration, not a headless release service.
- The verified scope is folder-based
GeneratedFilesmanufacturing output, such as Gerber, NC Drill, ODB++, IPC-2581, and some netlist outputs. Exact behavior remains dependent on the installed Altium version. - PDF/Publish document containers, including schematic prints, PCB prints, and Draftsman output, are not currently supported reliably. The runner also does not iterate every output container in a mixed-media OutJob.
- The OutJob must be listed as a document in the
.PrjPcb, not merely stored beside it. When running a disposable project copy, use its project-bound OutJob withstage_outjob_copy=False; copying only the OutJob to a temporary path can break the project-document identity required by Altium. OutJobRunResult.successmeans the Altium script returned its completion marker without a reported script error. Altium can still generate zero files, so automation must verify its expected artifacts before accepting a run.
For document/PDF output, use Altium's OutJob editor to generate each container or use the Project Releaser, which can target a local folder or a connected Workspace. Altium's own documentation states that direct OutJob generation is per container; there is no single batch command for every output container. See Preparing Manufacturing Data with Output Jobs and Design Project Release.
Tracked reports: #33,
#34, and
#61.
See the Launcher & OutJobs guide for the full
automation boundary, operational caveats, and when to use board.fab() instead.
Install
This repository publishes two separate PyPI wheels that version and evolve together:
altium-monkey— the core Python libraryaltium-cruncher— the companion CLI (acr,altium-cruncher,ad)
Normal GIL-enabled CPython 3.12 through Python 3.14 are supported for both packages. Free-threaded Python builds are not currently part of the support contract.
Install the Python library:
pip install altium-monkey
# or with uv
uv add altium-monkey
Install the companion CLI (acr):
uv tool install altium-cruncher
uv tool update-shell
acr version
See Installation & Packages for the full Python/OS matrix
and CLI setup details, and CLI Quick Start for acr
workflows (acr fab, acr pcb-svg, acr toon, acr bom, acr pnp, and
more).
Install the optional example dependencies before running the full example set:
pip install "altium-monkey[examples]"
With uv, use uv run --extra examples ... so examples that synthesize STEP
geometry receive CadQuery without changing the core runtime environment.
The package includes dependencies for SVG text shaping and STEP-model bounds.
STEP bounds use the required wn-geometer==2026.11.22 dependency, which
publishes wheels for Windows amd64, macOS arm64, and Linux x86_64/aarch64 using
manylinux_2_35; other platforms are not currently part of the install support
boundary. See RELEASE_NOTES.md for platform and
Python-version boundaries. CadQuery is needed only by examples that synthesize
new STEP models.
Public API Compatibility
We strive to maintain compatibility for documented public APIs between releases. The API surface may still change as more Altium capabilities are modeled, especially in areas that are currently marked as release boundaries or advanced usage. Compatibility-affecting changes and migration notes will be documented in release notes.
Quick Start
Parse a project and emit the public design JSON contract:
from altium_monkey import AltiumDesign
design = AltiumDesign.from_prjpcb("example.PrjPcb")
payload = design.to_json(include_pnp=False) # Schematic-only; no board parse.
Project loading is proportional to the requested work. The default FULL
mode loads the schematic/compiler context but does not parse any referenced
PcbDoc. Use METADATA_ONLY when a tool needs project parameters, variants, or
document discovery without loading either schematics or boards:
from altium_monkey import AltiumDesign, AltiumProjectLoadMode
design = AltiumDesign.from_prjpcb(
"example.PrjPcb",
load_mode=AltiumProjectLoadMode.METADATA_ONLY,
)
board = design.load_pcbdoc() # The board is parsed only when requested.
Create or modify a schematic, then save it:
from altium_monkey import AltiumSchDoc, SchFontSpec, SchRectMils, make_sch_note
schdoc = AltiumSchDoc("input.SchDoc")
note = make_sch_note(
bounds_mils=SchRectMils.from_corners_mils(1000, 3000, 2600, 2400),
text="Added by altium-monkey",
font=SchFontSpec(name="Arial", size=10),
)
schdoc.add_object(note)
schdoc.save("output.SchDoc")
Create a simple PCB primitive:
from altium_monkey import AltiumPcbDoc, PcbLayer
pcbdoc = AltiumPcbDoc()
pcbdoc.add_track(
(1000, 1000),
(2500, 1000),
width_mils=8,
layer=PcbLayer.TOP,
net="GND",
)
pcbdoc.save("output.PcbDoc")
Documentation
Documentation is authored in Markdown under docs/ and can also be built into
a self-contained Monkey-themed static HTML site (uv run python tools/build_docs.py):
- Getting Started & Core Patterns — Overview, Installation & Packages, Core API Patterns, Asset & Library Extraction, and Text & Font Rendering.
- Domain Guides — organized by domain:
- PCB Domain: PcbDoc,
PCB Layers & Stackups,
PcbLib,
Fab & FabView (Gerber X2/X1, NC drill, IPC-2581B, PCB SVG,
PnP, BOM; ODB++ planned on
FabView), and Virtual Fab Layers. - Schematic Domain: SchDoc, SchLib, and Schematic Rendering & Paint IR.
- Projects, Design & Multi-Board: PrjPcb, AltiumDesign & Compiled Design, Multi-Board Systems, and IntLib.
- Draftsman & Desktop: Draftsman and Launcher & OutJobs.
- PCB Domain: PcbDoc,
PCB Layers & Stackups,
PcbLib,
Fab & FabView (Gerber X2/X1, NC drill, IPC-2581B, PCB SVG,
PnP, BOM; ODB++ planned on
- CLI (
altium-cruncher/acr) — CLI Quick Start & Config, Fabrication & Outputs, Rendering & Design Review, Monkey Change Orders (MCO), and Full Command Reference. - Examples Showcase & Python API Reference — runnable Python workflows in
examples/(Examples) plus the auto-generated Python API Reference inside the HTML site build. - Output & Wire Contracts — Format Contracts (Gerber, SVG, Schematic JSON Interop) and the unified JSON Schemas & TypeSpec guide.
- Altium Output Differences (AOD) & Releases — standalone AOD Register, per-version Release Notes, and Style Foundation.
Schematic SVG Fonts
Schematic SVG rendering uses installed fonts when it can resolve the requested
Altium font family. On macOS, the resolver searches the standard system font
locations, including Supplemental fonts. Callers can also set
ALTIUM_FONT_DIRS to one or more additional font directories.
When a common Altium/Windows family is unavailable, schematic rendering can use
bundled open-source fallback fonts. Arial and Microsoft Sans Serif-style
families substitute Arimo, Times New Roman-style families substitute Tinos, and
Courier New or monospace families substitute Cousine. Schematic SVG now uses
Paint IR A0 and SchPaintSvgOptions:
from altium_monkey import SchPaintSvgOptions
svg = schdoc.to_svg(options=SchPaintSvgOptions())
outlined_svg = schdoc.to_svg(options=SchPaintSvgOptions(text_mode="paths"))
The default keeps text as SVG text. Use text_mode="paths" to outline text when
viewers may lack the selected font. The current Paint IR SVG adapter does not
embed fallback font files; embed_bundled_fallback_fonts=True is unsupported.
A compact SVG viewed on a machine without the selected fallback family may not
reproduce the renderer's text metrics exactly.
See Schematic Rendering & Paint IR for the current API and removed GOTIR surface.
PCB Fonts
PCB TrueType text in the Gerber, IPC-2581 and SVG outputs is drawn in the font Altium draws, by Altium's own rule. On Linux and macOS the standard Windows fonts are drawn with the same open stand-ins (Arimo, Tinos, Cousine) the schematic uses. A font report lists each font a board uses and what to do about it. See Fonts.
Contributing
This repository is a published mirror. Issues, minimal reproduction cases, documentation fixes, API feedback, and focused pull requests are welcome, but PRs may be adapted or reimplemented in the upstream development workspace before they are mirrored back here. See CONTRIBUTING.md.
API Shape
The schematic side uses a higher-level object system:
AltiumSchDocandAltiumSymbolownObjectCollectioninstances.- Typed views such as
schdoc.notesandsymbol.pinsare live query views. - Structural mutations should go through
add_object(...),insert_object(...), orremove_object(...).
The PCB document side is helper-oriented rather than ObjectCollection-based:
AltiumPcbDocandAltiumPcbFootprintexpose high-leveladd_*methods.AltiumPcbDoccovers common authoring workflows including board setup, nets, primitives, components, footprint insertion, component bodies, and embedded 3D model placement. Via support includes IPC-4761 type metadata, feature rows, propagation delay, tenting, and testpoint flags.- Parsed primitives are available through typed record lists such as
pcbdoc.tracks,pcbdoc.pads,pcbdoc.vias, andpcbdoc.components. - Direct record-list mutation is possible but should be treated as advanced usage until PcbDoc grows a generic object API.
See API patterns for units, object ownership, public vs careful APIs, and internal Altium unit guidance.
Testing And Interoperability
altium-monkey is validated against real-world Altium files spanning multiple
Altium eras from "Summer '08" to present day, covering round-trip parsing,
binary serialization, SVG rendering, and comparisons against Altium Designer
captures.
No tool can prove perfect compatibility with every historical Altium file. If
you find a parsing, serialization, SVG, or interoperability issue, please file
an issue with the smallest representative .SchDoc, .SchLib, .PcbDoc, or
.PcbLib that reproduces the problem.
Release Boundaries
Known release boundaries include:
- PcbDoc does not yet use
ObjectCollection; it remains a typed-list plus helper-oriented API. - PcbDoc does not yet have a public generic object deletion API.
- IntLib support is extract-only, with fallback source-stream extraction when component cross-reference metadata cannot be parsed.
- Variant processing supports DNP handling and parameter overrides; alternate fitted component replacement is not applied semantically yet.
- Complex hierarchical channels route through the compiled design model for
design JSON, netlist JSON, and physical schematic SVG/IR output. Rich
consumers should use the required Design b0
compiled_schematic_graphand select pages by canonical page occurrence id instead of assuming one source SVG ID maps to one physical component. - Project design JSON emits
altium_monkey.design.b0(with requiredaltium_monkey.compiled_schematic_graph.a0and opt-in compile metadata viato_json(include_compile_metadata=True)). For strict recursive electrical membership, Net Tie bridges, authored field-impact tracing, and Paint IR occurrence bindings, use the checked C0 compilation surface (AltiumCompilation/AltiumCompiledView, emittingaltium_monkey.compilation.c0,compiled_view.c0,structural_graph.c0,compiled_schematic_graph.b0, andpaint_bindings.c0). - Windows remains the primary validation platform. macOS font discovery and bundled schematic font substitution have focused coverage; Linux coverage remains limited and may rely more heavily on bundled substitutions.
See RELEASE_NOTES.md for the full current support boundary.
License
altium-monkey is licensed under the GNU Affero General Public License v3.0 or
later. See LICENSE.
Metadata
Release files for altium-monkey 2026.11.26
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| altium_monkey-2026.11.26.tar.gz | 6.2 MB | With provenance | Details for altium_monkey-2026.11.26.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| altium_monkey-2026.11.26-py3-none-any.whl | Python 3 | none | any | Details for altium_monkey-2026.11.26-py3-none-any.whl |
Total release size: 12.8 MB
Release files / altium_monkey-2026.11.26.tar.gz
| Download URL | altium_monkey-2026.11.26.tar.gz |
|---|---|
| Size | 6.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8cf35af77e7b13dd13e86a140502715fd86da212800373c8d56a060098892ae
|
|
BLAKE2b-256 checksum How to use checksums |
68494cbb20bc405416273a9fc40767faa6788c644c1b1fe85311e1e909f846f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 28, 2026.
Transparency logRelease files / altium_monkey-2026.11.26-py3-none-any.whl
| Download URL | altium_monkey-2026.11.26-py3-none-any.whl |
|---|---|
| Size | 6.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
237a1cd595a0e12d4adce5d992c9765009a27593c415f06b3be6d4f473f8b0ea
|
|
BLAKE2b-256 checksum How to use checksums |
46fdaeccdbf286124693f72fdd85bb49edd3bb45a0b640392afb13da90633a77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 28, 2026.
Transparency logSecurity for altium-monkey 2026.11.26
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for altium_monkey-2026.11.26.tar.gz
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 Nov 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.