Installation

The gemmology.dev ecosystem consists of five Python packages that work together to parse, compute, render, and query crystal structures.

Requirements

  • Python 3.10 or higher
  • pip (Python package manager)

Quick Install

Install all packages at once:

pip install gemmology-cdl-parser gemmology-crystal-geometry gemmology-mineral-database gemmology-crystal-renderer

Virtual Environment (Recommended)

We recommend using a virtual environment to avoid dependency conflicts:

# Create a virtual environment
python -m venv venv

# Activate it (Linux/macOS)
source venv/bin/activate

# Activate it (Windows)
venv\Scripts\activate

# Install packages
pip install gemmology-cdl-parser gemmology-crystal-geometry gemmology-mineral-database gemmology-crystal-renderer

Individual Packages

You can also install packages individually, depending on your needs:

Package Version Purpose Install Command
gemmology-cdl-parser 1.3.0 Parse CDL expressions (zero dependencies) pip install gemmology-cdl-parser
gemmology-crystal-geometry 1.0.5 Generate 3D geometry pip install gemmology-crystal-geometry
gemmology-mineral-database 1.8.1 Access mineral presets (96 families, 128 expressions) pip install gemmology-mineral-database
gemmology-crystal-renderer 1.0.1 Render to SVG/STL/glTF pip install gemmology-crystal-renderer
gemmology-cdl-lsp 1.1.0 Language Server Protocol for editors pip install gemmology-cdl-lsp

Development Installation

For contributing or modifying the source code, clone the repositories and install in editable mode:

# Clone the repository
git clone https://github.com/gemmology-dev/cdl-parser.git
cd cdl-parser

# Install in development mode with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

Verify Installation

Verify that everything is installed correctly:

python -c "from cdl_parser import parse_cdl; print(parse_cdl('cubic[m3m]:{111}'))"

You should see a CrystalDescription object printed to the console.

Optional Dependencies

Some features require additional dependencies:

Feature Package Install Command
SVG raster conversion cairosvg, Pillow pip install gemmology-crystal-renderer[raster]
YAML mineral export pyyaml pip install gemmology-mineral-database[yaml]
LSP preview crystal-geometry, crystal-renderer pip install gemmology-cdl-lsp[preview]