Giter Club home page Giter Club logo

gaia-beet's Introduction

gaia-beet

GitHub Actions PyPI PyPI - Python Version Code style: black Discord

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

gaia-beet's People

Contributors

misode avatar actions-user avatar

Stargazers

Quidvio avatar  avatar Valentin Berlier avatar

Watchers

 avatar  avatar

Forkers

jacobsjo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.