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

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

Uploaded CPython 3.8+Windows x86-64

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

Uploaded CPython 3.8+macOS 11.0+ ARM64

nucleation-0.2.2-cp38-abi3-macosx_10_12_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: nucleation-0.2.2.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.2.tar.gz
Algorithm Hash digest
SHA256 7a006e041c4501f8a50ea2e4e907a30625d764364532ff4fa0df94f6ede654a6
MD5 cf8f779baa53da0d95656f775873b80c
BLAKE2b-256 a6e6a408d6f1ab3b89aa38d2d3a9c187bbcfba1fd411ba814898bc7d6e84e44a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nucleation-0.2.2-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.2-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b8b121fe92b0171ce7db95468cc9d31fec799f26d661038416d2b40d34213de7
MD5 ce9e9ea2448668a14027b0ad229710cd
BLAKE2b-256 eabe9cf7934bda41d60e1aa03dd90b56aa1200186376195e6855e6944a847b0f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e3719d008bc4be402bed521fc4eeedc715514ed75e38ac0231c0610dc662aacd
MD5 0ac80b58657c074b038e399344014993
BLAKE2b-256 38638e8d2e8a76bdb05b4927e2b7166a727bd59fa07a19f4922755fac3080745

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2f473a888830b0b487f88a0311862dd4bce2f14ef106885168ad7be337c62eec
MD5 d3f093c6e13dc23a1f80dcf491f07865
BLAKE2b-256 93b065a090f1f60a1c5fbf5c1a452ea6f321f076ff116d937fd86a5de02c7420

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.2-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 44a379b5091da919ac3f55abea3d08e0fea40956264df0e7773b45aa4d80ade5
MD5 a323ba3fdd21226d08961fd537cd4892
BLAKE2b-256 ba27c334cfcf427221edd33c0506600b8c2ea397984fa72ca33641b9d8b494c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.2-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6e3442f7d9dbd3e995a956d9cbc98ce630061ba11fdaba45eee5de256748f76b
MD5 2e638eb57a0ff7a38f1425269c5cc9f8
BLAKE2b-256 9ca3184267e3467b069d9be96abf851a80e4563b2cb40f6623eaa0b3ad164caf

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