A Python package for rendering protein structures in 3D using Ursina, as featured in Ursina's sample projects.
The package is published on PyPI, and can be installed with pip install ursina-proteins.
You can also clone the repo down and install dependencies with uv.
# Clone the repo
git clone https://github.com/HarrisonTCodes/ursina-proteins.git
cd ursina_proteins
# Install dependencies with uv
uv syncYou can render proteins from files in the (default) PDB format, or the mmCIF/PDBx format (by passing legacy_pdb = False in the Protein class constructor). Many protein files can be found at the RCSB Protein Data Bank.
You can use the library in an existing Ursina project by importing the Protein class and creating an instance from a protein file.
from ursina_proteins.protein import Protein
Protein("/path/to/file.pdb")You can also test the library out by running demo.py. This script renders a simple scene with an example protein (insulin).
uv run src/demo.pyContributions are welcome. Please enable pre-commit hooks to catch and fix formatting/linting issues locally before raising a PR.
# Enable pre-commit hooks
uv run pre-commit install