Skip to main content

mcapy

Documentation Status Tests

Python reader and writer for Minecraft region MCA (aka Anvil File Format) files.

It only works for the files from Minecraft v1.18 onward.

Installation

This project is available on PyPI and can be installed with pip

pip install mcapy

or directly from github

pip install git+https://github.com/wensheng/mcapy.git

Usage

Reading

from mca import Region

region = Region.from_file('r.0.0.mca')
chunk = region.get_chunk(0, 0)
block = chunk.get_block(0, 0, 0)

print(block)
print(block.id)
print(block.properties)

Making own regions

from mca import Block, EmptyRegion
from random import choice

# Create a new region with the `EmptyRegion` class at 0, 0 (in region coords)
region = EmptyRegion(0, 0)

# Create `Block` objects that are used to set blocks
stone = Block('minecraft', 'stone')
dirt = Block('dirt')  # you can omit 'minecraft' namespace

# Make a 16x16x16 cube of either stone or dirt blocks
for y in range(16):
    for z in range(16):
        for x in range(16):
            region.set_block(choice((stone, dirt)), x, y, z)

# Save to a file
region.save('r.-1.-1.mca')

Note

This project is originally forked from anvil-parser, which was archived by its author.

Metadata

Release files for mcapy 0.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcapy 0.9.1
File Size Uploaded Provenance
mcapy-0.9.1.tar.gz 19.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcapy 0.9.1
File Interpreter ABI Platform
mcapy-0.9.1-py3-none-any.whl Python 3 none any Details

Total release size: 40.8 kB

Release files / mcapy-0.9.1.tar.gz

Download URL mcapy-0.9.1.tar.gz
Size 19.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c15dccfcc65c7e10b492422c3558b07a7d375cb82bf3e355714abb3706cf4f7c
BLAKE2b-256 checksum
How to use checksums
c8f6c25d867bfcf21c4ebae848b87f33dda179acdae7c03c8ab75a4b06f0ce61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release files / mcapy-0.9.1-py3-none-any.whl

Download URL mcapy-0.9.1-py3-none-any.whl
Size 21.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7787e9cc75e6e673c51ea26f361411ba0bf472ace73e0d0c78425be900d3693d
BLAKE2b-256 checksum
How to use checksums
30b4bbea78755ee0dce0a54d4b06c9e18bffcb9e883f3c1507e055c6f5ac666c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Security for mcapy 0.9.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.9.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page