Skip to main content

High quality Minecraft world editor

Project description

PyCraft is a high-quality Python library for offline edition of Minecraft worlds. High-quality, because it respects the spirit of the Python programming language (i.e. it is pythonic), and because it also takes care of memory consumption, which can be a huge problem during Minecraft world edition. PyCraft complies with Python 3.3 specifications.

PyCraft is governed by the CeCILL-C license under French law and abiding by the rules of distribution of free software.

Quick and dirty: edit a NBT-formatted file

Here is an example of modifications that can be operated with PyCraft on a file stored with NBT encoding format. NBT encoding is widely used in Minecraft.

from pycraft import con

# Load our favorite TAG_COMPOUND
W = con.load("entry.nbt")

# Add some meaningful information :)
W["author"] = "Me, myself and I"
W["date"] = "2014-02-26"

# By default, ints are of kind TAG_LONG. Nobody likes show-offs
W["nb_of_followers"] = 42
W.set_kind("nb_of_followers") = con.TAG_BYTE

# Save it back
W.save("entry.nbt")

Known limitations of using PyCraft with a Python 2.7 interpreter

The current section lists the packages of PyCraft that won’t work if you use a Python 2.7 interpreter:

  • con.py considers TAG_STRING items to be stored as str() object, whereas in Python 2.7 it should be as unicode() object. As this last type has been removed, there is no way to use the con.py package properly if you deal with TAG_STRING items.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyCraft-1403020.tar.bz2 (24.0 kB view details)

Uploaded Source

File details

Details for the file PyCraft-1403020.tar.bz2.

File metadata

  • Download URL: PyCraft-1403020.tar.bz2
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyCraft-1403020.tar.bz2
Algorithm Hash digest
SHA256 c8646926e4b4445f95278231341e47905e7e1402d86b93a97bd6145c99fe4726
MD5 9cedc4528b658b63f71ad30dc5de343b
BLAKE2b-256 ce9d7178e9eb7cb00f22219fc454d86cab4c61c6efd3dd783d5b0583d3c5c1c9

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