---
name: tetramol
description: >
  Use when writing Python code that uses the tetramol package.
license: MIT
compatibility: Requires Python >= 3.13.
---

# tetramol

## Installation

```bash
pip install tetramol
```

## API overview

### Classes

Core classes

- `Builder`: Build a molecule atom by atom on a tetrahedral grid

### Builder Methods

Methods for the Builder class

- `Builder.slot_direction`
- `Builder.open_slots`
- `Builder.add`
- `Builder.add_hydrogens`
- `Builder.geometry`
- `Builder.umbrella_image`

### Functions

Public functions

- `orient`: Rotate a geometry by hand in the browser and get the rotation
- `render`: Render a geometry as an SVG, looking down the z axis (x right, y up)
- `tetrahedral_basis`: Get the four bond directions of a tetrahedral grid
- `draw.orient_page`
- `draw.serve_orient_page`

### Constants

Module-level constants and data

- `VALENCES`: dict() -> new empty dictionary
- `STYLE`: Rendering settings
- `TETRAHEDRAL_ANGLE`: Convert a string or number to a floating-point number, if possible
- `XH_LENGTH`: Convert a string or number to a floating-point number, if possible
- `XY_LENGTH`: Convert a string or number to a floating-point number, if possible

### Other

Additional exports

- `grid`: The tetrahedral grid: ideal bond directions, angles, and lengths

## Resources

- [Full documentation](https://avcopan.github.io/tetramol/)
- [llms.txt](llms.txt) — Indexed API reference for LLMs
- [llms-full.txt](llms-full.txt) — Comprehensive documentation for LLMs
- [Source code](https://github.com/avcopan/tetramol)
