# mceditlib.pc package — mceditlib 0.1 documentation

### Navigation

- index
- modules |
- next |
- previous |
- mceditlib 0.1 documentation »
- mceditlib package »

# mceditlib.pc package

## Submodules

## mceditlib.pc.regionfile module

RegionFile class.

Reads and writes chunks to .mcr (Minecraft Region) and .mca (Minecraft Anvil Region) files

exception `mceditlib.pc.regionfile.``RegionFormatError`

  Bases: `exceptions.RuntimeError`

  Raised on an error in the region file format.

`mceditlib.pc.regionfile.``deflate`(data)

`mceditlib.pc.regionfile.``inflate`(data)

class `mceditlib.pc.regionfile.``RegionFile`(path)

  Bases: `object`

  `SECTOR_BYTES` = 4096
  `CHUNK_HEADER_SIZE` = 5
  `VERSION_GZIP` = 1
  `VERSION_DEFLATE` = 2
  `usedSectors`
  `sectorCount`
  `chunkCount`
  `chunkPositions`()
  `repair`()
    Fix the following problems with the region file:
      - remove offset table entries pointing past the end of the file
      - remove entries that overlap other entries
      - relocate offsets for chunks whose xPos,yPos don’t match
  `readChunkCompressed`(cx, cz)

    Read a chunk and return its compression type and the compressed data as a (data, fmt) tuple

  `readChunkBytes`(cx, cz)

    Parameters:

    - cx –
    - cz –

    Returns: |
    Return type: | bytes

  `writeChunkBytes`(cx, cz, uncompressedData)
  `writeChunkCompressed`(cx, cz, data, format)
  `writeSector`(sectorNumber, data, format)
  `containsChunk`(cx, cz)
  `deleteChunk`(cx, cz)
  `getTimestamp`(cx, cz)
  `setTimestamp`(cx, cz, timestamp=None)

## Module contents

__init__.py

### Navigation

- index
- modules |
- next |
- previous |
- mceditlib 0.1 documentation »
- mceditlib package »