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

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

Uploaded CPython 3.8+Windows x86-64

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

Uploaded CPython 3.8+macOS 11.0+ ARM64

nucleation-0.2.5-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.5.tar.gz.

File metadata

  • Download URL: nucleation-0.2.5.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.5.tar.gz
Algorithm Hash digest
SHA256 6a59deb95772d72c791fe5d9fdab6241fbbf3206cbfe81d28e27ae07bbd0374c
MD5 17dfb0763b4173e11505b0713e35909c
BLAKE2b-256 509563aa1343a44099967c99b6b54695d77b84d349e2ac2a67f93c97d833a445

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nucleation-0.2.5-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.5-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ba6c82b115dfa7738a54c9fc65552e99b17653875a1803ecfbdc1add9ca72bee
MD5 86255dc6d235d1fdfd238baa7cb09ad4
BLAKE2b-256 ca0382e24ead7ba9c47d54e11cdda6c5a3772541294f89d2596a6dd7433f6c13

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c2295d75edf4f3d5b6c3f1f96954964c7b227ba6af4ece2c151e59d3b06f006a
MD5 28532bc592d76027bb4b2a2c49e84154
BLAKE2b-256 b4ff474f3fc9be0d467083a097789a99132965c8a284dc2665db5eb87170f619

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 072ecdcef880d857925bf068868d513e3728c3c9a4d7b1f5bb2086c0b37265b9
MD5 a2a9d4a7a8837f7b4444964a8a72b86f
BLAKE2b-256 9a6571622ae20d6f59a60ca213352ed4a4c4fe77488403510f9a9ae12860ea4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.5-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4947bc89fbd7882b175885a5d27b2a9588d02f9ef19a57e9788f1eac3be67ede
MD5 07b8fafe31368bbb58d99fe84a312e79
BLAKE2b-256 90d83db1247db7bda9df7606e3aeac1fa9949f06f861a9674c6047eeb29d9a3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.5-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4ff0624acf21c9d76640e7ca384ec47c57fa167ef38a6ddca9b9dce0a9a993ab
MD5 57fd8ae97d4eac7d461237f49655ebea
BLAKE2b-256 3e7411e5a2d5c46ca24b21ac1ca4f5ac9ce946ab6f04ae3182e6f22cc7aa8302

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