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

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

Uploaded CPython 3.8+Windows x86-64

nucleation-0.2.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB view details)

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

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

Uploaded CPython 3.8+macOS 11.0+ ARM64

nucleation-0.2.4-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.4.tar.gz.

File metadata

  • Download URL: nucleation-0.2.4.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.4.tar.gz
Algorithm Hash digest
SHA256 8bad7fd46e2af4258f713940b273d340538a10c769b1b2e110659ed63dbb49be
MD5 9f7511603d7731daa97c974b8e29b799
BLAKE2b-256 3decc347b0c3e3c6ec14f3b361c3fd8b6f946bc0f7c6a0d0f389138c5e00a5cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nucleation-0.2.4-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.4-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4ec713825f5e3110794d000a6f2453bd02f5c273291a857a5cacffd9f1bd5e54
MD5 0f54af60b28030d3383a6cf36198bfc1
BLAKE2b-256 f44218957b4d53fd0b6b10e94c7f750d86b74ac1e16aaa2e319afd79445dd602

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 05ad75b93cce955123a476ea806f346fe2ef411b7e6623d21c792a60c2b6262c
MD5 6475120420fd2076918980c8b5df2334
BLAKE2b-256 5d5c5b73b3ea60f0b6cf90b2f0c929b8037cdd7644e1f5dc247c903cc8f56b1a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7ade6575737ff6b602b8a7471f142c6759a662a4380237d0dbc4ece2b0ed0253
MD5 f86bd1e7a55dd4117de490b6f4f565e8
BLAKE2b-256 62f380ae0efef8fb0186dd6707a3b26c6d81a6d699ec38b9b6b557700359d66b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.4-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 439af8e359f717bdd7b4d3a4e127fcb3afe5faa9638ff168f5f20156094dc6fa
MD5 4cdacee417580bbae5ed23fe67d68270
BLAKE2b-256 e39514fffd8989b4085172304c35a3e80ebbe24a0eb715a32d29dc37ee4a8f88

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nucleation-0.2.4-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 44542a44de7ebf823bd4182bbe413018f33e27400af6dc452d034ed4eed84ae6
MD5 be8aeea2a1915691a957cf9ab1886de3
BLAKE2b-256 9d5d32cb16565c6a7b3337ef0bd01a90c00e9c7098945033149f614eeecab980

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