anvil-parser
Simple parser for the Minecraft anvil file format
Installation
This project is available on PyPI and can be installed with pip
pip install anvil-parser
or directly from github
pip install git+https://github.com/matcool/anvil-parser.git
Usage
Reading
import anvil
region = anvil.Region.from_file('r.0.0.mca')
# You can also provide the region file name instead of the object
chunk = anvil.Chunk.from_region(region, 0, 0)
# If `section` is not provided, will get it from the y coords
# and assume it's global
block = chunk.get_block(0, 0, 0)
print(block) # <Block(minecraft:air)>
print(block.id) # air
print(block.properties) # {}
Making own regions
import anvil
from random import choice
# Create a new region with the `EmptyRegion` class at 0, 0 (in region coords)
region = anvil.EmptyRegion(0, 0)
# Create `Block` objects that are used to set blocks
stone = anvil.Block('minecraft', 'stone')
dirt = anvil.Block('minecraft', 'dirt')
# 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.0.0.mca')
Todo
things to do before 1.0.0
- Proper documentation
- Biomes
- CI
- More tests
- Tests for 20w17a+ BlockStates format
Note
Testing done in 1.14.4 and 1.15.2, should work fine for other versions.
Metadata
Release files for anvil-parser 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| anvil-parser-0.9.0.tar.gz | 25.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| anvil_parser-0.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 54.2 kB
Release files / anvil-parser-0.9.0.tar.gz
| Download URL | anvil-parser-0.9.0.tar.gz |
|---|---|
| Size | 25.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7cd457cf465c1d6d8f6dc52b0689a56e84e498c1a4c27802e725ede982698f9d
|
|
BLAKE2b-256 checksum How to use checksums |
0ae97d2f3fb897e1a1fc3af922f6142eb37acdb3ff287ee77de8d528c3420f2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.2rc1
|
Release files / anvil_parser-0.9.0-py3-none-any.whl
| Download URL | anvil_parser-0.9.0-py3-none-any.whl |
|---|---|
| Size | 28.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3e6284194b7db0f2e7b7a4b2437e0215961eba1ef94ab1080c0a100ad8145dc
|
|
BLAKE2b-256 checksum How to use checksums |
1b3e1b47956916ce1d43507f5d890534c5d60049cabdd2f3ee6ab1da28e6a792
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.2rc1
|
Security for anvil-parser 0.9.0
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.