Skip to main content

Bolt Anchors

Name resource locations and build nested paths in bolt.

Bolt anchors let you bind a resource declaration to an identifier with the as clause. The anchor can then be used as a value or extended with / to build nested resource locations.

Installation

pip install bolt-anchors

Configuration

Add the plugin to your beet.yml/beet.json after bolt.

pipeline:
  - mecha

require:
  - bolt
  - bolt_anchors

Usage

Bind an anchor when declaring any resource. The anchor holds the fully resolved resource location of the declaration.

append function ~/foo as foo:
    print(foo)
    function foo / "bar":
        say foo bar

foo resolves to namespace:foo/foo (relative to the current file and the enclosing declarations) and foo / "bar" extends it into a nested resource location. Anchors work for any resource type and any path depth.

loot_table ./technical/loot as LOOT {}
print(LOOT)

Anchors can be used as values, interpolated into strings, and reused when declaring or calling other resources.

function ~/utils as utils:
    function utils / "math" / "add":
        scoreboard players add @s points 1

advancement ./tech/root as ROOT {}
predicate ROOT / "check" {}
say f"prefix is {utils}"
function utils / "math" / "add"

Moving the path scope

The anchor command changes the current path scope without creating a resource. Nested locations and anchors inside its block resolve against the new location.

anchor demo:foo as foo:
    function ~/bar as bar:
        print(bar) # demo:foo/bar
    function foo / "baz" as baz:
        print(baz) # demo:foo/baz

The block itself emits no file. Commands and statements inside an anchor block are treated like regular top-level code and are inlined into the current file, while any resource declarations create files relative to the new scope.

Development

uv sync --dev
uv run pytest
uv run ruff check

Release files for bolt-anchors 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bolt-anchors 0.1.0
File Size Uploaded
bolt_anchors-0.1.0.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bolt-anchors 0.1.0
File Interpreter ABI Platform
bolt_anchors-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.6 kB

Release files / bolt_anchors-0.1.0.tar.gz

Download URL bolt_anchors-0.1.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
736f222853f50e72a080c15e8ef9e0aa47df73cf8081fab30cd88a575f985d65
BLAKE2b-256 checksum
How to use checksums
5305d9a19c2db6644b2366c738d6e4f24d50f8380932e75724b05357e77a6c59
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 21, 2026.

Transparency log

Release files / bolt_anchors-0.1.0-py3-none-any.whl

Download URL bolt_anchors-0.1.0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
41567120ef69ca06cc2e8d5be85ebf7d73ffbe9ced83e485b309bef5e0f7bb57
BLAKE2b-256 checksum
How to use checksums
b5ed499b2bd8af2e1c28a5c81e6b82acde1ae26ec335c9cf291759003ba3c39f
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 21, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 This release

2 release files

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