Skip to main content

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:

  1. .SchDoc
  2. .SchLib
  3. .PcbDoc
  4. .PcbLib
  5. .PrjPcb
  6. .OutJob
  7. .IntLib extraction
  8. .PCBDwf Draftsman files, currently experimental

Common workflows:

  1. create and mutate schematic documents
  2. create schematic symbols and PCB footprints
  3. insert SchLib symbols and PcbLib footprints
  4. extract SchLib and PcbLib data from projects
  5. render logical schematic SVGs, compiled physical schematic SVGs, and PCB SVGs
  6. inspect PCB layers, drills, board outlines, nets, and net classes
  7. author and mutate PCB vias, including IPC-4761 protection metadata
  8. extract embedded fonts and 3D models
  9. generate project containers and, on Windows with Altium Designer installed, run associated OutJobs within the limitations below
  10. 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 GeneratedFiles manufacturing 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 with stage_outjob_copy=False; copying only the OutJob to a temporary path can break the project-document identity required by Altium.
  • OutJobRunResult.success means 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 library
  • altium-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):

  1. Getting Started & Core Patterns — Overview, Installation & Packages, Core API Patterns, Asset & Library Extraction, and Text & Font Rendering.
  2. Domain Guides — organized by domain:
  3. CLI (altium-cruncher / acr) — CLI Quick Start & Config, Fabrication & Outputs, Rendering & Design Review, Monkey Change Orders (MCO), and Full Command Reference.
  4. Examples Showcase & Python API Reference — runnable Python workflows in examples/ (Examples) plus the auto-generated Python API Reference inside the HTML site build.
  5. Output & Wire Contracts — Format Contracts (Gerber, SVG, Schematic JSON Interop) and the unified JSON Schemas & TypeSpec guide.
  6. 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:

  1. AltiumSchDoc and AltiumSymbol own ObjectCollection instances.
  2. Typed views such as schdoc.notes and symbol.pins are live query views.
  3. Structural mutations should go through add_object(...), insert_object(...), or remove_object(...).

The PCB document side is helper-oriented rather than ObjectCollection-based:

  1. AltiumPcbDoc and AltiumPcbFootprint expose high-level add_* methods.
  2. AltiumPcbDoc covers 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.
  3. Parsed primitives are available through typed record lists such as pcbdoc.tracks, pcbdoc.pads, pcbdoc.vias, and pcbdoc.components.
  4. 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:

  1. PcbDoc does not yet use ObjectCollection; it remains a typed-list plus helper-oriented API.
  2. PcbDoc does not yet have a public generic object deletion API.
  3. IntLib support is extract-only, with fallback source-stream extraction when component cross-reference metadata cannot be parsed.
  4. Variant processing supports DNP handling and parameter overrides; alternate fitted component replacement is not applied semantically yet.
  5. 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_graph and select pages by canonical page occurrence id instead of assuming one source SVG ID maps to one physical component.
  6. Project design JSON emits altium_monkey.design.b0 (with required altium_monkey.compiled_schematic_graph.a0 and opt-in compile metadata via to_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, emitting altium_monkey.compilation.c0, compiled_view.c0, structural_graph.c0, compiled_schematic_graph.b0, and paint_bindings.c0).
  7. 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)

Source distribution for altium-monkey 2026.11.26
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)

Table of built distributions (wheels) for altium-monkey 2026.11.26
File Interpreter ABI Platform Actions
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 log

Release 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 log

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

Select from 2 files

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 log

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

Release history Release notifications | RSS feed

This release

2026.11.26 This release

2 release files Full provenance

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