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.6

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

Uploaded CPython 3.8+Windows x86-64

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

Uploaded CPython 3.8+macOS 11.0+ ARM64

nucleation-0.2.6-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.6.tar.gz.

File metadata

  • Download URL: nucleation-0.2.6.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.6.tar.gz
Algorithm Hash digest
SHA256 4bce9012e64c994eb765afd5a7a648e685004dc4b54a22b4e4281ff3b57d6541
MD5 f932a9de546d85376a8c08116fe4e055
BLAKE2b-256 f889acb33488ece19281c1ce450829314fe5d3165226e2183ec777460fa05404

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nucleation-0.2.6-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.6-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 44379f0a34768c09f7ddd764545dfac558d14b3527ac46b0a42b83d930aa7004
MD5 69d5fd70001f48790f6faed63d019bb3
BLAKE2b-256 4b4a12fef7334e0e2a4c94d00f1104ba2459fb979c674c00f043358f146973a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aa55072ba6447b6ec6416fe829eb9137874e35c3e01d63da8db7972715ac3f48
MD5 08a0fd3eb7985de129ef59d3793d2f8c
BLAKE2b-256 82bccd0c76cbde9132a98584537b203769d3b5b8245ebff1768ab0bb469e13bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.6-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2f554e345e0b3364dcfab4659f1bf06582bea9207a3802c8fcf15ae873392a16
MD5 d36f9cd05333aebf001fe955908f2024
BLAKE2b-256 14433a0af2a5027b740928b25ab7e328831d28161fa8576e8c3392990f6f796e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.6-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 77aaa2f4d07a097f8c33caceff9030854d98403a41ae791e8384d3388a15ecef
MD5 f2c29596dcf57a70af54ef3057132b76
BLAKE2b-256 3bbfd6274d1c9a04c3fd34dc596f00e631b37268920f44c959cbc2a6401425e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.6-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4a6e03c5e3aac725ed99aaa26f8efbb98c0af567f421164cc955dcc4072084c3
MD5 9f8a0ffb007f3941dcb85d35e7396255
BLAKE2b-256 418c37bb0a34e92241610b79fb18bbc1f556c818cbbc34022f901dfd3608ab2e

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