nucleation
A high-performance Minecraft schematic engine, powered by a native Rust core. Parse, edit, diff, fingerprint, and generate schematics from Python.
Policy-driven normalization, material profiles, content inspection, UUID standardization, bounded decoding, and registry routing are documented in the complete transformation-policy guide.
Wheels are published for CPython 3.12+ (stable ABI) on Linux, macOS, and Windows.
They include a py.typed marker and generated .pyi stubs for Mypy, Pyright,
and editor completion. The installed package-level __init__.pyi explicitly
re-exports every generated native type, followed by the hand-written veneer
types; this keeps package exports equally visible to Mypy and Pyright while
preserving the native classes' type identities.
Install
pip install nucleation
Quick start
import nucleation
schematic = nucleation.Schematic.create("demo")
schematic.set_block(1, 2, 3, "minecraft:stone")
print(schematic.get_block_name(1, 2, 3)) # "minecraft:stone"
schematic.save_to_file("demo.litematic")
loaded = nucleation.Schematic.load_from_file("demo.litematic")
Normalize imported content
Preview and apply the same versioned policy contract used by every language binding:
from nucleation import Schematic, TransformPlan, inspect_transform, apply_transform
schematic = Schematic.open("incoming.schem")
plan = TransformPlan.registry_safe()
preview = inspect_transform(schematic, plan)
if not preview.rejected and not preview.quarantined:
report = apply_transform(schematic, plan)
schematic.save("normalized.schem")
Inspection never mutates the schematic. Apply is atomic: a rejecting rule
returns report.rejected == True and leaves the original unchanged. For only
lossless palette cleanup, use TransformPlan.canonical().
Split disconnected builds
Keep every meaningful connected machine independent while attaching only tiny, nearby loose parts:
schematic = nucleation.Schematic.open("combined.schem")
pieces = schematic.split_connected_attach_nearby(
16, # components this large always remain standalone
3, # tiny parts may attach across at most three empty blocks
)
for index in range(pieces.len()):
pieces.piece(index).save(f"machine-{index + 1}.schem")
Attachment is lossless and non-transitive: fragments cannot form a chain that recombines otherwise independent builds. Whole-world extraction, including the Python control plane and remote Store worker, is documented in the world-segmentation guide.
To emit every disconnected component literally, use a zero standalone threshold. Every component then becomes a core and the gap is ignored:
pieces = schematic.split_connected_attach_nearby(0, 0)
Curate a lossless corpus
Keep raw extraction lossless, then build registry and ranking views with an auditable policy. Every rejected ID and reason is retained:
from pathlib import Path
from nucleation import (
CurationPolicy,
curate_corpus,
write_registry_archives,
write_top_owner_archives,
)
policy = CurationPolicy.minima(
min_blocks=2, # reject standalone blocks
min_palette_names=2, # reject one-material schematics
name="ore-sanity-v1",
)
corpus = curate_corpus(Path("/data/ore"), Path("/data/ore/curation/ore-sanity-v1"), policy)
write_registry_archives(corpus, Path("/data/ore/registry-import"))
write_top_owner_archives(corpus, Path("/data/ore/top-20-owner-archives"))
CurationPolicy also accepts declarative MetricRule entries over analyser or
catalogue fields and named Python predicates. The policy receives a stable
SHA-256 content ID which is embedded into package indexes and owner manifests.
Changing a filter therefore cannot silently reuse an older curated result.
What is included
The published wheel contains the core feature set: schematic editing, all schematic formats, world import and export (including streaming), the schematic builder, the procedural building tool, definition regions, diff and fingerprinting, autostack, NBT helpers, SDF sampling, and the in-memory/filesystem store.
Redstone simulation, mesh generation, GPU rendering, and embedded scripting require building the package from source with the extra cargo features enabled (a Rust toolchain is required):
git clone https://github.com/Schem-at/Nucleation
cd Nucleation
pip install ./bindings/python
The source build defaults to the full feature set (bridge-full). Set the
NUCLEATION_FEATURES environment variable to choose a different cargo feature list,
for example NUCLEATION_FEATURES=bridge,simulation.
Documentation
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nucleation-0.10.14.tar.gz.
File metadata
- Download URL: nucleation-0.10.14.tar.gz
- Upload date:
- Size: 2.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bf0af2c5e06686a2db9d6d0f0885b5802a6c87d81325f7765aa98026406e39a
|
|
| MD5 |
4934b60852a3e8f89b2558f3dd185c0f
|
|
| BLAKE2b-256 |
805be04933567eda71903d6ad60f4843aad3ff9b1a1792c805ae89a5f9206ae4
|
File details
Details for the file nucleation-0.10.14-cp312-abi3-win_amd64.whl.
File metadata
- Download URL: nucleation-0.10.14-cp312-abi3-win_amd64.whl
- Upload date:
- Size: 11.9 MB
- Tags: CPython 3.12+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ac3b4e3b42ec089576ab3bf4fddfe4b41003d8080213dede057d5b5d3b83b81
|
|
| MD5 |
92412158b32161bb59137091d1d7a689
|
|
| BLAKE2b-256 |
e4812b0b31dbbc384748edf14b704b5221f58d35b189636b4fc6be0e3a6abaa4
|
File details
Details for the file nucleation-0.10.14-cp312-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: nucleation-0.10.14-cp312-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 17.0 MB
- Tags: CPython 3.12+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
965d46fbdae7ff95992ee9ba35c8e9b62aef5d03454bc92f72070aa4d7c5e286
|
|
| MD5 |
60b37ca75c33b84c0f7cfd6ca9595118
|
|
| BLAKE2b-256 |
eef156e06ca540e60522c6969036a327f7ee97fd9cfcde7cc84d6fbf1c489404
|
File details
Details for the file nucleation-0.10.14-cp312-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: nucleation-0.10.14-cp312-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 14.0 MB
- Tags: CPython 3.12+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18a620fa99f24988f2963763734d48b22ff3cfc66a9c01c19d6a1f49302d0d1a
|
|
| MD5 |
d180516fe661c3888e31011d41d7e2ef
|
|
| BLAKE2b-256 |
fe4c3362ae1d6f9e2200c499de77e196c6a00d093cdb4ee79d6689f28a85bc73
|