rapidobj is a fast Wavefront OBJ parser exposed as a Python extension module
using nanobind. It returns NumPy views for mesh data so parsing and data access
stay efficient.
- Python 3.12+
- CMake 3.18+
- A C++17 compiler
From PyPI:
python -m pip install rapidobjFrom source:
uv sync --no-dev
uv build --wheel --python 3.12 --no-sources
python -m pip install dist/rapidobj-0.1.3-cp312-cp312-*.whlFor release builds, GitHub Actions is the authoritative wheel pipeline. Pull requests validate the package, and version tags build Linux and Windows wheels for CPython 3.12, 3.13, and 3.14. Tag builds publish the validated artifacts to PyPI via Trusted Publishing after a strict version check.
For releases, use the helper script so the package version and tag stay in lockstep:
uv run python scripts/release.py X.Y.Z
git push origin HEAD vX.Y.Zfrom rapidobj import parse_obj
result = parse_obj("mesh.obj")
if not result.ok:
raise RuntimeError(result.error_message)
print(result.vertices.shape) # (V, 3)
print(result.faces.shape) # (F, 3)
print(result.texcoords.shape) # (T, 2)See examples/ for runnable scripts.
parse_obj(filename: str) -> ObjParseResultObjParseResult.ok: boolObjParseResult.error_message: strObjParseResult.vertex_count: intObjParseResult.normal_count: intObjParseResult.uv_count: intObjParseResult.shape_count: intObjParseResult.material_count: intObjParseResult.texture_paths: list[str]ObjParseResult.vertices: np.ndarrayObjParseResult.faces: np.ndarrayObjParseResult.texcoords: np.ndarrayObjParseResult.wedge_texcoord_indices: np.ndarrayObjParseResult.wedge_material_ids: np.ndarray
Release workflow and checklist are documented in RELEASE.md.