# jerschro/molecule_lib architecture

> Architecture diagram of the GitHub repository jerschro/molecule_lib, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jerschro/molecule_lib
- Repository: https://github.com/jerschro/molecule_lib

## Overview

molecule_lib is a Python library for reading, converting, and manipulating molecular structures. The principal workflow is a Python caller using its molecule and coordinate API to work with structure data; documented capabilities include format conversion, precise 3D movement and rotation, atom reordering, and unit-cell editing. The large CIF-related module is represented separately as crystallographic conversion support. The excerpts do not show the runtime call paths or most feature implementations, so the graph avoids inferring links between them.

Main entry points: [`src/molecule_lib/__init__.py`](https://github.com/jerschro/molecule_lib/blob/main/src/molecule_lib/__init__.py) (Molecule API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_molecule["Molecular structures"]
  node_api["Molecule API<br/>[__init__.py]"]
  node_cif["CIF conversion data<br/>[cif2pos.py]"]
end

node_caller(("Python caller"))

node_caller -->|"uses"| node_api

click node_api "https://github.com/jerschro/molecule_lib/blob/main/src/molecule_lib/__init__.py"
click node_cif "https://github.com/jerschro/molecule_lib/blob/main/src/molecule_lib/cif2pos.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_cif toneBlue
class node_caller toneIndigo
```

## Components

### Molecular structures

- [Molecule API](https://github.com/jerschro/molecule_lib/blob/main/src/molecule_lib/__init__.py): `src/molecule_lib/__init__.py`
- [CIF conversion data](https://github.com/jerschro/molecule_lib/blob/main/src/molecule_lib/cif2pos.py): `src/molecule_lib/cif2pos.py`

### Other components

- **Python caller**

## Connections

- Python caller → Molecule API: uses (evidence: `README.md`)
