Beet plugin to generate Minecraft worldgen files
Project description
gaia-beet
Beet plugin to generate Minecraft worldgen files
Introduction
Writing density functions in JSON by hand can be tiring and confusing. This package allows you to write them as natural looking expressions.
gaia.df("basic:foo", abs(const(4) ** 3) + ref("basic:bar"))
Installation
The package can be installed with pip
.
$ pip install gaia-beet
Getting started
When using with beet
, a simple beet.yml
is enough:
output: out
pipeline:
- main
This references a main.py
plugin file where the density functions will be defined:
from beet import Context
from gaia_beet import Gaia
from gaia_beet.density_functions import *
def beet_default(ctx: Context):
gaia = ctx.inject(Gaia)
blah = slide(const(2))
foo = gaia.df("basic:foo", abs(const(4) ** 3) + blah)
gaia.df("basic:bar", blah * foo)
Then install beet and run the watch command:
$ pip install beet
$ beet watch
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
.
$ poetry install
You can run the tests with poetry run pytest
.
$ poetry run pytest
The project must type-check with pyright
. If you're using VSCode the pylance
extension should report diagnostics automatically. You can also install the type-checker locally with npm install
and run it from the command-line.
$ npm run watch
$ npm run check
The code follows the black
code style. Import statements are sorted with isort
.
$ poetry run isort gaia_beet examples tests
$ poetry run black gaia_beet examples tests
$ poetry run black --check gaia_beet examples tests
License - MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gaia-beet-0.5.1.tar.gz
.
File metadata
- Download URL: gaia-beet-0.5.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf80aa3fa437106168be225ab70981a5052dbca4e5d2ec0ecc3ec80bf332da3c |
|
MD5 | 351c0b385c87d70bc9d7d6d62b315b15 |
|
BLAKE2b-256 | 22cb2e36019ac068fd381e28b5d72cf7c74cf9a4d20a001e2630e32e05c0c903 |
File details
Details for the file gaia_beet-0.5.1-py3-none-any.whl
.
File metadata
- Download URL: gaia_beet-0.5.1-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa3824aeb7c0e8741f30ea7a9ed2f33b3b31f1a6f3e9979ab66f080c2cf0d7d9 |
|
MD5 | af2baabe6103c8938b15d79f9201b63e |
|
BLAKE2b-256 | 9a401a8fa7a9d8dedc952da29c97637a0273961a92ad0859f63417097d3cbea7 |