Skip to main content

pyworldgen

A unified, deterministic procedural biome-generation library. A seed plus parameters is the world — voxel grids, meshes, point clouds and saved chunks are all regenerable views of that compact source.

What's in it

  • Biomes — implicit caves, Voronoi forests, river landscapes, and a neutral flat terrain.
  • Composition — blend several biomes into one coherent world with smooth transitions.
  • Roads — weighted anisotropic least-cost paths (Galin et al. 2010) over any terrain, with bridges and terrain grading.
  • Chunked voxel world — block storage, generation-pass scheduler, streaming, deferred edits, sunlight.
  • Geometry views — voxel meshers, surface point-cloud sampling with farthest-point downsampling, OBJ / MagicaVoxel .vox / PLY / XYZ export.
  • Rendering — pure-numpy pinhole camera and software renderer, plus PyVista and matplotlib backends, with PNG / GIF / MP4 output.
  • Spatial toolkit — spatial hash grid, BVH, KD-tree, R-tree, quad/octree, voxel DDA, graph + Dijkstra, farthest point sampling.

Everything shares one cross-language deterministic hash, so the same seed reproduces the same world bit-for-bit across Python, JavaScript and GLSL.

Quick start

import pyworldgen as bf

bf.list_generators()
# ['composite', 'flat', 'forest', 'implicit_cave', 'landscape', 'roads']

forest = bf.generate("forest",        seed="grenoble",   target_tree_count=60)
cave   = bf.generate("implicit_cave", seed="luxembourg", length=90.0)
land   = bf.generate("landscape",     seed="rhine")
world  = bf.generate("composite",     seed="atlas")

Export a biome as voxels, mesh, and a downsampled point cloud:

from pyworldgen.mesh import volume_to_mesh
from pyworldgen.pointcloud import sample_mesh_surface
from pyworldgen.io import volume_to_vox, mesh_to_obj, write_ply

volume_to_vox("cave.vox", cave)
mesh = volume_to_mesh(cave)
mesh_to_obj("cave.obj", mesh)

cloud = sample_mesh_surface(mesh, 40_000, seed=1)
write_ply("cave_points.ply", cloud.farthest_point_downsample(4_096))

Render a turntable fly-through:

import pyworldgen.rendering as rr

frames = rr.render_turntable(cloud, n_frames=48, elevation=18)
rr.save_gif(frames, "cave_orbit.gif", fps=20)

Installation

pip install -e .          # runtime
pip install -e ".[dev]"   # + pytest

Runtime dependencies: numpy, scipy, fpsample, matplotlib, pillow, imageio, pyvista. Optional extras: [viz] (scikit-image) and [geometry] (shapely, trimesh, mapbox-earcut).

Visualization scripts

python scripts/visualize_all.py --quick --out sample_visualizations
python scripts/render_biome.py composite --seed atlas --quick

Where to look next

  • algo_specs/ — per-biome algorithm specs (cave, landscape, tree, flat).
  • CITATIONS.md — paper-level references per source file.
  • Module docstrings (pyworldgen.biomes.*, pyworldgen.roads, pyworldgen.compose, pyworldgen.noise, …) — the authoritative description of each layer, including scope and honest gaps versus the cited papers.
  • tests/ — invariants and reproducibility checks worth reading as usage examples.

Metadata

Release files for pyworldgen 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyworldgen 0.1.8
File Size Uploaded Provenance Actions
pyworldgen-0.1.8.tar.gz 116.2 kB With provenance Details for pyworldgen-0.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyworldgen 0.1.8
File Interpreter ABI Platform Actions
pyworldgen-0.1.8-py3-none-any.whl Python 3 none any Details for pyworldgen-0.1.8-py3-none-any.whl

Total release size: 246.5 kB

Release files / pyworldgen-0.1.8.tar.gz

Download URL pyworldgen-0.1.8.tar.gz
Size 116.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d80592baf4a610966e51c00037952abfb06b32b14ca56c8f7098558271a0d95d
BLAKE2b-256 checksum
How to use checksums
80c8dac833f8c14262e81a555889fb484111ac7713ebf141a73b6220481c8405
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / pyworldgen-0.1.8-py3-none-any.whl

Download URL pyworldgen-0.1.8-py3-none-any.whl
Size 130.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5e6f4be8d3c026692be05f6ae1d37079ef00285864fbb6cf61c29b661498480d
BLAKE2b-256 checksum
How to use checksums
72853cc190e339a4f7536ed0b072bd61726c633e27be963d8fd4a6d9edd8186e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Security for pyworldgen 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyworldgen-0.1.8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page