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

This version

0.2.3

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.3.tar.gz (4.9 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.3-cp38-abi3-win_amd64.whl (5.3 MB view details)

Uploaded CPython 3.8+Windows x86-64

nucleation-0.2.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB view details)

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

nucleation-0.2.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.7 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

nucleation-0.2.3-cp38-abi3-macosx_11_0_arm64.whl (4.7 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

nucleation-0.2.3-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.3.tar.gz.

File metadata

  • Download URL: nucleation-0.2.3.tar.gz
  • Upload date:
  • Size: 4.9 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.3.tar.gz
Algorithm Hash digest
SHA256 46b45bcb9919ac938318028367737d808c318ff54b4a935f2bb97329e80c248c
MD5 9ce7b0bc5b989c51ec75579dc4c5fef7
BLAKE2b-256 4141d9a260814a18a24efb185501f172e1a40e09dbe7a92ce2ac37c1e259055b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nucleation-0.2.3-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.3-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 df66a6b9e2b2cd9ae258cc7d7982d689a52725c06c08758bc1ae25eb4b67fa91
MD5 6810936ae1b96a4101e117ac3f71f363
BLAKE2b-256 6cc6b52392e950bf713094b8797601cd60a0f2fe3f6a9395cc697c10dea0c3bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b2c02f5414dc8662fd0ca87d09ab44070e825730457a01ccc1985559180302d5
MD5 1ef8e1096b397ef1003cc30db2854084
BLAKE2b-256 38c368c354dfac92566c7379a633586143f3b4e03677a66806c52c2034a4e015

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 003b2b4e5658b3daccf138e26d6b51c1866d6a3c37316bf998aeda2df13a63d1
MD5 580e1d1b2e2f17279a2f6865c6e9a3ac
BLAKE2b-256 736655384df7d1bca64e5a9a643d60b5e833b68d129e84451d915a1d45e8c12f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9813f02d3d8b3ebdecee24f2f58d4252b18138ed7c84e41b94d61e781321a6f9
MD5 926af4b94fb82906ccb274669ef12d62
BLAKE2b-256 2d057a9b291092be0d379608eebce3d696d8d7efcc1351e16b3455146e487198

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.3-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e5f78538f3d40ab043125b035313ff55ede73bde6afe92b4913a734213f59a34
MD5 d241503e6488de0db8fd79c846bd9ce7
BLAKE2b-256 56e417d384ed9085ab78ad4759a11ef2ac5e0d57c2917ebe8622077285a525fd

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