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.11.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.11-cp38-abi3-win_amd64.whl (5.4 MB view details)

Uploaded CPython 3.8+Windows x86-64

nucleation-0.2.11-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.11-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.11-cp38-abi3-macosx_11_0_arm64.whl (4.7 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

nucleation-0.2.11-cp38-abi3-macosx_10_12_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: nucleation-0.2.11.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.11.tar.gz
Algorithm Hash digest
SHA256 e4ed5f878fa6af187d1f5d21407bc51dc42994c747ee069c56fbb79c34554205
MD5 a153caa5cd03f42ab3489360423cbf91
BLAKE2b-256 5f752935949c4c22a95f08b40fbf21246aa1e6af8b41900d60cf7434b6c3c456

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nucleation-0.2.11-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 5.4 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.11-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a7d763d7cf58a16d6a52d91db403491c173d0975ad22679306044b024ca45ce7
MD5 73f881c0414d17f3a9565244b61424e7
BLAKE2b-256 5fbef3e00c6f41f62ae3d9d033bb7214b7ebb4ed0c405598dd1005edb0421907

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.11-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 81c074a3202273d1eb36b19b264c797accb887412f45a4c116dae73de834d3b4
MD5 943fb4a402906e9890f6599f1c42fce0
BLAKE2b-256 9fcb5e8f4ea36b811f1fdee531f7883f3c0470d38c84f7ad91b7a06c3a141d02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.11-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a5e08cec0c0e99cb93aa3ad527c0084a5b650284756f6759127a4818cbb0e7ea
MD5 3be9755afa1c09480f72f5c81e83b95c
BLAKE2b-256 a8b87c9126ac729fdc8f886231fdba4c2525de488ce8a02cc006c98d380e9c11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.11-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 93aafbfd0c68b293537a1543179e57f413211731a8129ae70ed02550d6b75f1b
MD5 3cd5129bffa1260da9eeac2ac6a7c94e
BLAKE2b-256 67737cd0369817fde421d6c65367f56c1df55c18462870bd5775abe4612c266e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.11-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 cce57a944545f444636c4de9e434587e63686808e51ca02084e718b2d91852e7
MD5 5ad73f656696638eb2c06b730007f59f
BLAKE2b-256 8f1f75f74106a2ab6b07ef2fe8489d2742a420abd8474e731e5298303250c8a5

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