Skip to content

newexo/python-minecraft-data

 
 

Repository files navigation

python-minecraft-data

Provide easy access to minecraft-data in Python.

This is a fork of the original python-minecraft-data with modern packaging infrastructure and lazy data loading using Pooch.

Features

  • Lazy data loading — Data is downloaded on-demand using Pooch and cached locally
  • Efficient caching — Downloaded data is cached in ~/.cache/minecraft_data (configurable)
  • Modern packaging — Built with Poetry and PEP 517/518 standards
  • Comprehensive tests — 90%+ code coverage with pytest
  • CI/CD ready — GitHub Actions workflow with coverage enforcement

Installation

Clone and install from source:

git clone https://github.com/newexo/python-minecraft-data
cd python-minecraft-data
poetry install

Usage

import minecraft_data

# Load a specific version
mc_data = minecraft_data("1.21.6")

# Access version info
print(mc_data.version)

# Access items, blocks, etc. (if available for that version)
if hasattr(mc_data, 'items'):
    print(mc_data.items)

Supported Versions

Currently supported for detailed testing:

  • 1.20.6
  • 1.21.6

Other versions in the minecraft-data repository are accessible but may have incomplete data.

Data Source

This library provides Python access to the PrismarineJS minecraft-data project, which contains comprehensive Minecraft game data in JSON format.

Configuration

Custom cache location

Set the MINECRAFT_DATA_DIR environment variable to use a custom cache directory:

export MINECRAFT_DATA_DIR=/custom/path/to/minecraft/data
python your_script.py

Development

Run tests

make test

Run linting and formatting

make check      # Format, lint, and test
make format     # Black formatting
make lint       # Flake8 linting

Coverage

make coverage           # Terminal report
make coverage-html      # HTML report

License

MIT — See LICENSE for details.

Attribution

About

Provide easy access to minecraft-data in python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 95.2%
  • Makefile 4.8%