▓▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓▓▓▓░░░░░░▓▓░░░░░░▓▓▓▓
░░░░▓▓░░░░░░░░░░░░░░░░░░▓▓░░░░
░░░░▓▓░░ ░░░░░░ ░░▓▓░░░░
░░▓▓░░██ ░░░░░░██ ░░▓▓░░
▓▓░░░░░░░░░░░░░░░░░░▓▓
▓▓░░░░░░░░░░░░░░▓▓
▓▓▓▓░░░░░░▓▓▓▓
▓▓▓▓▓▓ ░░
▓▓▓▓▓▓▓▓▓▓ ▓▓
▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓▓▓▓░░▓▓░░▓▓▓▓
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.
Core file types:
.SchDoc.SchLib.PcbDoc.PcbLib.PrjPcb.OutJob.IntLibextraction
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 schematic 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 run associated OutJobs
Python 3.11 and Python 3.12 are supported for this release.
pip install altium-monkeyor with uv:
uv add altium-monkeyFor running the examples, prefer uv run .... It is the highest-probability
path for using the expected interpreter and dependencies without local
environment drift.
The package includes dependencies for SVG text shaping and STEP-model bounds. See RELEASE_NOTES.md for platform and Python-version boundaries.
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.
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()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")The public docs are Markdown-first for this release:
The examples are the best starting point for public API usage. They are kept in
examples/ and are indexed from examples/manifest.toml.
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.
altium-monkey is developed against a large private corpus and
real-world Altium files spanning multiple Altium eras from "Summer '08" until present day. Interoperability checks include round-trip parsing, binary serialization, SVG rendering, and native
Altium oracle comparisons where practical. The test corpus is not included in the public package.
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.
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 and
.Annotationfile handling may need additional validation. - Windows remains the primary validation platform. Basic macOS operation and baseline font substitution have been checked; Linux coverage remains limited.
See RELEASE_NOTES.md for the full current support boundary.
altium-monkey is licensed under the GNU Affero General Public License v3.0 or
later. See LICENSE.