beet


Namebeet JSON
Version 0.105.0 PyPI version JSON
download
home_pagehttps://github.com/mcbeet/beet
SummaryThe Minecraft pack development kit
upload_time2024-04-28 23:32:00
maintainerNone
docs_urlNone
authorValentin Berlier
requires_python<4.0,>=3.10
licenseMIT
keywords beet minecraft datapack resourcepack mcfunction
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img align="right" src="https://raw.githubusercontent.com/mcbeet/beet/main/logo.png?sanitize=true" alt="logo" width="76">

# Beet

[![GitHub Actions](https://github.com/mcbeet/beet/workflows/CI/badge.svg)](https://github.com/mcbeet/beet/actions)
[![PyPI](https://img.shields.io/pypi/v/beet.svg)](https://pypi.org/project/beet/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/beet.svg)](https://pypi.org/project/beet/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![Discord](https://img.shields.io/discord/900530660677156924?color=7289DA&label=discord&logo=discord&logoColor=fff)](https://discord.gg/98MdSGMm8j)

> The Minecraft pack development kit.

## Introduction

Minecraft [resource packs](https://minecraft.gamepedia.com/Resource_Pack) and [data packs](https://minecraft.gamepedia.com/Data_Pack) work well as _distribution_ formats but can be pretty limiting as _authoring_ formats. You can quickly end up having to manage hundreds of files, some of which might be buried within the bundled output of various generators.

The `beet` project is a development kit that tries to unify data pack and resource pack tooling into a single pipeline. The community is always coming up with pre-processors, frameworks, and generators of all kinds to make the developer experience more ergonomic. With `beet` you can seamlessly integrate all these tools in your project.

### Screencasts

- **Quick start** [https://youtu.be/JGrJTOhG3pY](https://youtu.be/JGrJTOhG3pY)
- **Command-line** [https://youtu.be/fQ9up0ELPNE](https://youtu.be/fQ9up0ELPNE)
- **Library overview** [https://youtu.be/LDvV4_l-PSc](https://youtu.be/LDvV4_l-PSc)
- **Plugins basics** [https://youtu.be/XTzKmvHqd1g](https://youtu.be/XTzKmvHqd1g)
- **Pipeline configuration** [https://youtu.be/QsnQncGxAAs](https://youtu.be/QsnQncGxAAs)

### Library

```python
from beet import ResourcePack, Texture

# Open a zipped resource pack and add a custom stone texture
with ResourcePack(path="stone.zip") as assets:
    assets["minecraft:block/stone"] = Texture(source_path="custom.png")
```

The `beet` library provides carefully crafted primitives for working with Minecraft resource packs and data packs.

- Create, read, edit and merge resource packs and data packs
- Handle zipped and unzipped packs
- Fast and lazy by default, files are transparently loaded when needed
- Statically typed API enabling rich intellisense and autocompletion
- First-class [`pytest`](https://github.com/pytest-dev/pytest/) integration with detailed assertion explanations

### Toolchain

```python
from beet import Context, Function

def greet(ctx: Context):
    """Plugin that adds a function for greeting the player."""
    ctx.data["greet:hello"] = Function(["say hello"], tags=["minecraft:load"])
```

The `beet` toolchain is designed to support a wide range of use-cases. The most basic pipeline will let you create configurable resource packs and data packs, but plugins make it easy to implement arbitrarily advanced workflows and tools like linters, asset generators and function pre-processors.

- Compose plugins that can inspect and edit the generated resource pack and data pack
- Configure powerful build systems for development and creating releases
- First-class template integration approachable without prior Python knowledge
- Link the generated resource pack and data pack to Minecraft
- Automatically rebuild the project on file changes with watch mode
- Batteries-included package that comes with a few handy plugins out of the box
- Rich ecosystem, extensible CLI, and powerful generator and worker API

## Installation

The package can be installed with `pip`.

```bash
$ pip install beet
```

To create and edit images programmatically you should install `beet` with the `image` extra or install `Pillow` separately.

```bash
$ pip install beet[image]
$ pip install beet Pillow
```

You can make sure that `beet` was successfully installed by trying to use the toolchain from the command-line.

```bash
$ beet --help
Usage: beet [OPTIONS] COMMAND [ARGS]...

  The beet toolchain.

Options:
  -p, --project PATH  Select project.
  -s, --set OPTION    Set config option.
  -l, --log LEVEL     Configure output verbosity.
  -v, --version       Show the version and exit.
  -h, --help          Show this message and exit.

Commands:
  build  Build the current project.
  cache  Inspect or clear the cache.
  link   Link the generated resource pack and data pack to Minecraft.
  watch  Watch the project directory and build on file changes.
```

## Contributing

Contributions are welcome. Make sure to first open an issue discussing the problem or the new feature before creating a pull request. The project uses [`poetry`](https://python-poetry.org).

```bash
$ poetry install --extras image
```

You can run the tests with `poetry run pytest`. We use [`pytest-minecraft`](https://github.com/vberlier/pytest-minecraft) to run tests against actual Minecraft releases.

```bash
$ poetry run pytest
$ poetry run pytest --minecraft-latest
```

We also use [`pytest-insta`](https://github.com/vberlier/pytest-minecraft) for snapshot testing. Data pack and resource pack snapshots make it easy to monitor and review changes.

```bash
$ poetry run pytest --insta review
```

The project must type-check with [`pyright`](https://github.com/microsoft/pyright). If you're using VSCode the [`pylance`](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance) extension should report diagnostics automatically. You can also install the type-checker locally with `npm install` and run it from the command-line.

```bash
$ npm run watch
$ npm run check
```

The code follows the [`black`](https://github.com/psf/black) code style. Import statements are sorted with [`isort`](https://pycqa.github.io/isort/).

```bash
$ poetry run isort beet tests
$ poetry run black beet tests
$ poetry run black --check beet tests
```

---

License - [MIT](https://github.com/mcbeet/beet/blob/main/LICENSE)


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mcbeet/beet",
    "name": "beet",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "beet, minecraft, datapack, resourcepack, mcfunction",
    "author": "Valentin Berlier",
    "author_email": "berlier.v@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/be/bd/51e882f71ac08c7d2f6e6880d3268376774ea76c0cc9e5a7f8ca735802a2/beet-0.105.0.tar.gz",
    "platform": null,
    "description": "<img align=\"right\" src=\"https://raw.githubusercontent.com/mcbeet/beet/main/logo.png?sanitize=true\" alt=\"logo\" width=\"76\">\n\n# Beet\n\n[![GitHub Actions](https://github.com/mcbeet/beet/workflows/CI/badge.svg)](https://github.com/mcbeet/beet/actions)\n[![PyPI](https://img.shields.io/pypi/v/beet.svg)](https://pypi.org/project/beet/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/beet.svg)](https://pypi.org/project/beet/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n[![Discord](https://img.shields.io/discord/900530660677156924?color=7289DA&label=discord&logo=discord&logoColor=fff)](https://discord.gg/98MdSGMm8j)\n\n> The Minecraft pack development kit.\n\n## Introduction\n\nMinecraft [resource packs](https://minecraft.gamepedia.com/Resource_Pack) and [data packs](https://minecraft.gamepedia.com/Data_Pack) work well as _distribution_ formats but can be pretty limiting as _authoring_ formats. You can quickly end up having to manage hundreds of files, some of which might be buried within the bundled output of various generators.\n\nThe `beet` project is a development kit that tries to unify data pack and resource pack tooling into a single pipeline. The community is always coming up with pre-processors, frameworks, and generators of all kinds to make the developer experience more ergonomic. With `beet` you can seamlessly integrate all these tools in your project.\n\n### Screencasts\n\n- **Quick start** [https://youtu.be/JGrJTOhG3pY](https://youtu.be/JGrJTOhG3pY)\n- **Command-line** [https://youtu.be/fQ9up0ELPNE](https://youtu.be/fQ9up0ELPNE)\n- **Library overview** [https://youtu.be/LDvV4_l-PSc](https://youtu.be/LDvV4_l-PSc)\n- **Plugins basics** [https://youtu.be/XTzKmvHqd1g](https://youtu.be/XTzKmvHqd1g)\n- **Pipeline configuration** [https://youtu.be/QsnQncGxAAs](https://youtu.be/QsnQncGxAAs)\n\n### Library\n\n```python\nfrom beet import ResourcePack, Texture\n\n# Open a zipped resource pack and add a custom stone texture\nwith ResourcePack(path=\"stone.zip\") as assets:\n    assets[\"minecraft:block/stone\"] = Texture(source_path=\"custom.png\")\n```\n\nThe `beet` library provides carefully crafted primitives for working with Minecraft resource packs and data packs.\n\n- Create, read, edit and merge resource packs and data packs\n- Handle zipped and unzipped packs\n- Fast and lazy by default, files are transparently loaded when needed\n- Statically typed API enabling rich intellisense and autocompletion\n- First-class [`pytest`](https://github.com/pytest-dev/pytest/) integration with detailed assertion explanations\n\n### Toolchain\n\n```python\nfrom beet import Context, Function\n\ndef greet(ctx: Context):\n    \"\"\"Plugin that adds a function for greeting the player.\"\"\"\n    ctx.data[\"greet:hello\"] = Function([\"say hello\"], tags=[\"minecraft:load\"])\n```\n\nThe `beet` toolchain is designed to support a wide range of use-cases. The most basic pipeline will let you create configurable resource packs and data packs, but plugins make it easy to implement arbitrarily advanced workflows and tools like linters, asset generators and function pre-processors.\n\n- Compose plugins that can inspect and edit the generated resource pack and data pack\n- Configure powerful build systems for development and creating releases\n- First-class template integration approachable without prior Python knowledge\n- Link the generated resource pack and data pack to Minecraft\n- Automatically rebuild the project on file changes with watch mode\n- Batteries-included package that comes with a few handy plugins out of the box\n- Rich ecosystem, extensible CLI, and powerful generator and worker API\n\n## Installation\n\nThe package can be installed with `pip`.\n\n```bash\n$ pip install beet\n```\n\nTo create and edit images programmatically you should install `beet` with the `image` extra or install `Pillow` separately.\n\n```bash\n$ pip install beet[image]\n$ pip install beet Pillow\n```\n\nYou can make sure that `beet` was successfully installed by trying to use the toolchain from the command-line.\n\n```bash\n$ beet --help\nUsage: beet [OPTIONS] COMMAND [ARGS]...\n\n  The beet toolchain.\n\nOptions:\n  -p, --project PATH  Select project.\n  -s, --set OPTION    Set config option.\n  -l, --log LEVEL     Configure output verbosity.\n  -v, --version       Show the version and exit.\n  -h, --help          Show this message and exit.\n\nCommands:\n  build  Build the current project.\n  cache  Inspect or clear the cache.\n  link   Link the generated resource pack and data pack to Minecraft.\n  watch  Watch the project directory and build on file changes.\n```\n\n## Contributing\n\nContributions are welcome. Make sure to first open an issue discussing the problem or the new feature before creating a pull request. The project uses [`poetry`](https://python-poetry.org).\n\n```bash\n$ poetry install --extras image\n```\n\nYou can run the tests with `poetry run pytest`. We use [`pytest-minecraft`](https://github.com/vberlier/pytest-minecraft) to run tests against actual Minecraft releases.\n\n```bash\n$ poetry run pytest\n$ poetry run pytest --minecraft-latest\n```\n\nWe also use [`pytest-insta`](https://github.com/vberlier/pytest-minecraft) for snapshot testing. Data pack and resource pack snapshots make it easy to monitor and review changes.\n\n```bash\n$ poetry run pytest --insta review\n```\n\nThe project must type-check with [`pyright`](https://github.com/microsoft/pyright). If you're using VSCode the [`pylance`](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance) extension should report diagnostics automatically. You can also install the type-checker locally with `npm install` and run it from the command-line.\n\n```bash\n$ npm run watch\n$ npm run check\n```\n\nThe code follows the [`black`](https://github.com/psf/black) code style. Import statements are sorted with [`isort`](https://pycqa.github.io/isort/).\n\n```bash\n$ poetry run isort beet tests\n$ poetry run black beet tests\n$ poetry run black --check beet tests\n```\n\n---\n\nLicense - [MIT](https://github.com/mcbeet/beet/blob/main/LICENSE)\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "The Minecraft pack development kit",
    "version": "0.105.0",
    "project_urls": {
        "Documentation": "https://github.com/mcbeet/beet",
        "Homepage": "https://github.com/mcbeet/beet",
        "Repository": "https://github.com/mcbeet/beet"
    },
    "split_keywords": [
        "beet",
        " minecraft",
        " datapack",
        " resourcepack",
        " mcfunction"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5689592e90e63283e1b322bdaee690bc5b360ad47a22cd31204a38a085e26d94",
                "md5": "b3ac66d6712f235afd291d719193f6b2",
                "sha256": "7a0597568b9dc902d2ac7662ba464e8b925b9055037562687d7a3b8245ea7387"
            },
            "downloads": -1,
            "filename": "beet-0.105.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b3ac66d6712f235afd291d719193f6b2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 114731,
            "upload_time": "2024-04-28T23:31:55",
            "upload_time_iso_8601": "2024-04-28T23:31:55.766506Z",
            "url": "https://files.pythonhosted.org/packages/56/89/592e90e63283e1b322bdaee690bc5b360ad47a22cd31204a38a085e26d94/beet-0.105.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bebd51e882f71ac08c7d2f6e6880d3268376774ea76c0cc9e5a7f8ca735802a2",
                "md5": "68e4d210bff6d8e072324150cd9c2766",
                "sha256": "928e3adcb8ea750af50f1b0d27a3476d4fb74310807c8544f2c966e450ad4cdc"
            },
            "downloads": -1,
            "filename": "beet-0.105.0.tar.gz",
            "has_sig": false,
            "md5_digest": "68e4d210bff6d8e072324150cd9c2766",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 89797,
            "upload_time": "2024-04-28T23:32:00",
            "upload_time_iso_8601": "2024-04-28T23:32:00.038455Z",
            "url": "https://files.pythonhosted.org/packages/be/bd/51e882f71ac08c7d2f6e6880d3268376774ea76c0cc9e5a7f8ca735802a2/beet-0.105.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-28 23:32:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mcbeet",
    "github_project": "beet",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "beet"
}
        
Elapsed time: 0.24081s