planetoids

Planetoids is a high level Python API for generating interactive, procedurally generated worlds from data in a pandas DataFrame.


Keywords
interactive, 3D, plotting, world-building, data, science, GIS, cartography, data-science, jupyterlab, pandas, planetoids, plotly, python, terraform
License
MIT
Install
pip install planetoids==0.1-alpha.2

Documentation

Planetoids

Procedurally generated worlds.

Build Status Coverage Status Codacy Status Version Status License

What is it?

Planetoids is a high level Python API for generating interactive, procedurally generated worlds from data in a pandas DataFrame.

What does it do?

Currently, Planetoids is able to terraform a planet from two-dimensional data that has an optional cluster attribute. It's still very new and will be growing in capabilities, but for now the library can achieve the following when terraforming a new world:
  • generates somewhere in space to render your creation
  • generates an ecology based on input data statistics
  • generates land masses
    • these land masses have
      • topographic detail (contours)
      • relief detail (gradients)
  • generates lighting effects in the form of a hillshade

Your terraformed world can be rendered using many different map projections for different effects.

This is just the beginning

I'm hoping to add in hydrological effects, atmospheric effects, bathometry, vegetation, civilizations, animations and a whole lot more. If you'd be interested in helping shape and grow this library to its full potential, take a look at the issues with a good first issue label or raise an issue with features you think the library could benefit from.

How to create a Planetoid

Creating a Planetoid is as simple as
import planetoids as pt
planet = pt.Planetoid(df, x="x_column", y="y_column", cluster_field="cluster_column").fit_terraform()

For full working examples, check out the interactive online demo notebooks.

Installing

Planetoids depends on:
  • pandas
  • sklearn
  • shapely
  • pyproj
  • plotly
  • opencv
  • and their related dependencies like numpy and scipy

Install Options

PyPI:

pip install planetoids

Manual:

wget https://github.com/paulds8/planetoids/archive/master.zip
unzip master.zip
rm master.zip
cd planetoids
pip install -r requirements.txt

If you're on Windows and installing from PyPI or manually, you may need to install the following packages from the Windows binaries for your Python version here:

For use in JupyterLab:

In order to get planetoids rendering inline within JupyterLab you will need to ensure you have ipywidgets installed as well as the following extensions:

# Avoid "JavaScript heap out of memory" errors during extension installation
# (OS X/Linux)
export NODE_OPTIONS=--max-old-space-size=4096
# (Windows)
set NODE_OPTIONS=--max-old-space-size=4096

# Jupyter widgets extension
jupyter labextension install @jupyter-widgets/jupyterlab-manager@1.0 --no-build

# FigureWidget support
jupyter labextension install plotlywidget@1.1.1 --no-build

# and jupyterlab renderer support
jupyter labextension install jupyterlab-plotly@1.1.2 --no-build

# JupyterLab chart editor support (optional)
jupyter labextension install jupyterlab-chart-editor@1.2 --no-build

# Build extensions (must be done to activate extensions since --no-build is used above)
jupyter lab build

# Unset NODE_OPTIONS environment variable
# (OS X/Linux)
unset NODE_OPTIONS
# (Windows)
set NODE_OPTIONS=

Documentation

This library is super new, so there's not a ton of documentation to come by just yet, but the public-facing API is fully documented here.