Skip to main content

A high-performance Minecraft schematic parser and utility library

Project description

Nucleation for Python

PyPI

Python bindings for Nucleation, a high-performance Minecraft schematic engine. Read, edit, build, simulate, and mesh .schematic, .litematic, .nbt, and .mcstructure files — at native speed.

The core is written in Rust and compiled to a CPython extension via PyO3 (abi3-py38), so a single wheel works on every CPython 3.8+ on your platform — no Rust toolchain required to install.


Install

pip install nucleation

Pre-built wheels are published for:

  • Linux x86_64 and aarch64
  • macOS x86_64 (Intel) and arm64 (Apple Silicon)
  • Windows x86_64

If your platform isn't covered, pip will fall back to the source distribution and build locally (requires a Rust toolchain).


Quick start

from nucleation import Schematic, sign, text

# Three explicit constructors (legacy `Schematic("file.schem")` still works):
schem = Schematic.open("example.litematic")        # load from disk
fresh = Schematic.new("my_schematic")              # blank
templ = Schematic.from_template("ab\ncd")          # ASCII template

# Polished set_block: tuple coords, structured state and NBT, chainable.
schem.set_block((0, 0, 0), "minecraft:repeater",
                state={"delay": 4, "facing": "east"})
schem.set_block((0, 1, 0), "minecraft:oak_sign",
                state={"rotation": 8},
                nbt=sign([text("Hello", color="gold"), "world"]))

# Format inferred from extension.
schem.save("out.litematic")

Hot loops

For placing many blocks, prefer the batch and fast-path APIs:

# 30+ M placements/sec — one native call.
schem.set_blocks([(x, 0, 0) for x in range(1_000_000)], "minecraft:stone")

# 10+ M placements/sec — pre-resolve once, place by index.
stone = schem.prepare_block("minecraft:stone")
place = schem.place
for x, y, z in positions:
    place(x, y, z, stone)

Tile-entity helpers

from nucleation import Schematic, chest, sign, text, Item

schem = Schematic.new("loot_room")

schem.set_block((0, 0, 0), "minecraft:chest",
                state={"facing": "north"},
                nbt=chest([
                    Item("minecraft:diamond", count=64),
                    Item("minecraft:elytra"),
                ]))

schem.set_block((0, 1, 0), "minecraft:oak_sign",
                nbt=sign([text("Loot", color="gold"), "this way →"]))

Documentation

Full reference, including simulation, meshing, and resource-pack rendering, lives in the main repository:


Why Rust?

Nucleation's core is shared across Rust, WebAssembly/JS, Python, and C/PHP — one engine, one set of behaviour, one set of tests. The Python package you install is the same engine that powers the JS and Rust libraries; you get native throughput for free.

License

AGPL-3.0-only. See the main repository for details.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nucleation-0.2.10.tar.gz (5.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

nucleation-0.2.10-cp38-abi3-win_amd64.whl (5.3 MB view details)

Uploaded CPython 3.8+Windows x86-64

nucleation-0.2.10-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

nucleation-0.2.10-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.8 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

nucleation-0.2.10-cp38-abi3-macosx_11_0_arm64.whl (4.6 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

nucleation-0.2.10-cp38-abi3-macosx_10_12_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file nucleation-0.2.10.tar.gz.

File metadata

  • Download URL: nucleation-0.2.10.tar.gz
  • Upload date:
  • Size: 5.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for nucleation-0.2.10.tar.gz
Algorithm Hash digest
SHA256 928168828045d22c48eb3c3f03a1fd07b8874270b62f79eb0670034b4bbcc467
MD5 99060eddc5ec89c96ba60469a5477c69
BLAKE2b-256 6116f1adfb258ba4721482351515739a019e409e3eb701539899e8ee14f84498

See more details on using hashes here.

File details

Details for the file nucleation-0.2.10-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: nucleation-0.2.10-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 5.3 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for nucleation-0.2.10-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c252c1622db5dc7abeecb6b065ca4733a5cc5eed8e36de4f2a6e7656a6fe6210
MD5 f21727529218cf7c16a0c74f7fe32f1c
BLAKE2b-256 f7ce1b16297d0764b43bf909fe7ed41a59e3e88496cee4e436cce1797988a273

See more details on using hashes here.

File details

Details for the file nucleation-0.2.10-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nucleation-0.2.10-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bf614f81d643a356dfd26d9dcfb6bad59c663c1bd2cf7ab7db2ed389c759c086
MD5 4714a7051ad06dd17f782df5b30e5908
BLAKE2b-256 2bc28270cf7c732d0f19c23434db375994a4f503d1b86eb62ff528ef3522c3f5

See more details on using hashes here.

File details

Details for the file nucleation-0.2.10-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for nucleation-0.2.10-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ee507912c2b75ed53521c3c7b60d233e5d02d0a194078f387efa9078b8d08350
MD5 de31a734c2043b1ee0f54d53954b287c
BLAKE2b-256 e5de5dcd7cc014c86c9c15944d469850b34a84dd2356d1e1e27368b1868b434a

See more details on using hashes here.

File details

Details for the file nucleation-0.2.10-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nucleation-0.2.10-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1a4783078a01dc78b671578d8c7c9a3f4d3738f10f62a815d6a397e8158acaf5
MD5 722a181d3f930b56c8d8925624196a8d
BLAKE2b-256 344c9aa83821f975d997ceb1d1223758810424403571c263763efc1b17661f0a

See more details on using hashes here.

File details

Details for the file nucleation-0.2.10-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for nucleation-0.2.10-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2537fa72b88049b7fce78259450492d9667be0b13bce66a41ba6eec711ff373b
MD5 29a44f2e680dd532a587889a3b4016a2
BLAKE2b-256 6706a544bcaab0bf6b7f356bd3f0cb24e058f7bcc4d5268918e87c826e55554d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page