Skip to content

MakerRepo Library

The makerrepo Python package (imported as mr) is a lightweight library that provides decorators such as @artifact, @customizable, and @cached to annotate functions that build your models. The decorators have no effect on your existing Build123D code until it is discovered and run by tools such as MakerRepo CLI or MakerRepo.com CI. The goal is to enable a code-driven workflow locally (e.g. command-line tools) or in CI. The library does not assume how it will be consumed, so annotated functions can be used with other tools and frameworks as well. It brings Manufacturing as Code into the Build123D ecosystem.

The makerrepo library is open-source. Source code: makerrepo on GitHub.

Install with pip or uv:

pip install makerrepo
# or
uv add makerrepo

The library is non-intrusive: your existing code and build flow stay the same; the decorators only add metadata for tools that discover and run them.

Library concepts

Concept Decorator Purpose
Artifacts @artifact Mark a function that produces a CAD model to be built and published by MakerRepo.
Generators @customizable Parametric models: users tweak parameters (e.g. dimensions) and request new builds.
Cached functions @cached Cache expensive sub-builds by arguments so repeated calls reuse results.
Build Environment BuildEnv Standardized access to build metadata such as git commit, branch/tag, repository info, and versioned model settings.
Result and Versioned Model (return type) Wrap an artifact's primary model together with an optional variant (e.g. version-marked prototype).

For a minimal walkthrough, see Getting Started.

Quick reference

  • Artifacts@artifact, optional args: sample, cover, desc, short_desc, export_step, export_3mf. See Artifacts.
  • Generators@customizable with a Pydantic parameter model; optional sample_parameters. See Generators.
  • Cached@cached for expensive helpers; optional short_desc, desc. See Cached functions.
  • Build EnvironmentBuildEnv helper to read standardized MakerRepo build information (git hash, ref, repo, and version settings) consistently, both locally and on MakerRepo.com.
  • Result and Versioned ModelResult return type for artifact functions that need both a clean primary model and a versioned/development variant.

To build and run these locally (list, view, export, snapshot), use MakerRepo CLI.