Skip to content

runtoolkit/dataLib-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

dataLib-python

Python toolchain for dataLib datapack development.

Overview

A collection of Python utilities for building, validating, and maintaining the macroEngine-dp multi-version overlay system.

Requirements

  • Python 3.8+
  • Git (for repository operations)

Installation

git clone https://github.com/runtoolkit/dataLib-python.git
cd dataLib-python

Shell Aliases (Optional)

For quick access to tools, source the aliases file:

source aliases.sh

To make aliases permanent, add to your shell profile:

echo "source $(pwd)/aliases.sh" >> ~/.bashrc  # or ~/.zshrc

Tools

init.py

Initialize a new macroEngine datapack project with the standard directory structure.

python3 init.py <project_name> [output_dir]
# or with alias:
dl-init <project_name> [output_dir]

Arguments:

  • project_name - Name of the new datapack project
  • output_dir - (Optional) Directory to create the project in (defaults to current directory)

extract.py

Extract datapack structure from a built pack.

python3 extract.py [output_dir]
# or with alias:
dl-extract [output_dir]

lint.py

Lint mcfunction files for syntax errors and best practices.

python3 lint.py [--strict]
# or with alias:
dl-lint [--strict]

Options:

  • --strict - Enable stricter validation rules

pack.py

Package overlay directories into a distributable datapack.

python3 pack.py <source_dir> [output_file]
# or with alias:
dl-pack <source_dir> [output_file]

Arguments:

  • source_dir - Directory containing pack.mcmeta and data/
  • output_file - (Optional) Output .zip filename

validate.py

Validate datapack structure and mcfunction syntax.

python3 validate.py [build_path]
# or with alias:
dl-validate [build_path]

Arguments:

  • build_path - (Optional) Path to validate (defaults to current directory)

Project Structure

dataLib-python/
├── aliases.sh        # Shell alias definitions
├── init.py           # Project initialization tool
├── extract.py        # Datapack extraction tool
├── lint.py           # Mcfunction linter
├── pack.py           # Datapack packaging tool
├── validate.py       # Structure validator
├── LICENSE           # MIT License
└── README.md         # This file

Usage Examples

Initialize a new project

dl-init my-datapack
dl-init my-datapack ./projects/

Validate before commit

dl-lint --strict
dl-validate

Package a datapack

dl-pack overlays/1_21_6 output/macroEngine-1.21.6.zip

Extract existing pack

dl-extract unpacked/

Related Projects

License

MIT License - see LICENSE file for details.

Contributing

This toolchain is maintained as part of the macroEngine-dp project. Issues and PRs should be opened in the main repository.


Part of the runtoolkit organization | Maintained by @tickwarden

About

dataLib [PYTHON]

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages