Skip to main content

Fast OBJ parser with Python bindings

Project description

rapidobj

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.

Requirements

  • Python 3.12+
  • CMake 3.18+
  • A C++17 compiler

Install

From PyPI:

python -m pip install rapidobj

From source:

uv sync
uv build --wheel --python 3.12 --no-sources
python -m pip install dist/rapidobj-0.1.3-cp312-cp312-*.whl

For 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.Z

Minimal Usage

from 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.

API

  • parse_obj(filename: str) -> ObjParseResult
  • ObjParseResult.ok: bool
  • ObjParseResult.error_message: str
  • ObjParseResult.vertex_count: int
  • ObjParseResult.normal_count: int
  • ObjParseResult.uv_count: int
  • ObjParseResult.shape_count: int
  • ObjParseResult.material_count: int
  • ObjParseResult.texture_paths: list[str]
  • ObjParseResult.vertices: np.ndarray
  • ObjParseResult.faces: np.ndarray
  • ObjParseResult.texcoords: np.ndarray
  • ObjParseResult.wedge_texcoord_indices: np.ndarray
  • ObjParseResult.wedge_material_ids: np.ndarray

Release Notes

Release workflow and checklist are documented in RELEASE.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rapidobj-0.1.5.tar.gz (77.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rapidobj-0.1.5-cp314-cp314-win_amd64.whl (151.9 kB view details)

Uploaded CPython 3.14Windows x86-64

rapidobj-0.1.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (205.1 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

rapidobj-0.1.5-cp313-cp313-win_amd64.whl (148.1 kB view details)

Uploaded CPython 3.13Windows x86-64

rapidobj-0.1.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (205.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

rapidobj-0.1.5-cp312-cp312-win_amd64.whl (148.1 kB view details)

Uploaded CPython 3.12Windows x86-64

rapidobj-0.1.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (205.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file rapidobj-0.1.5.tar.gz.

File metadata

  • Download URL: rapidobj-0.1.5.tar.gz
  • Upload date:
  • Size: 77.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rapidobj-0.1.5.tar.gz
Algorithm Hash digest
SHA256 6ea4efe6582a3a5ca23d12aba20a325bc7ce63380ee5c387e1c7461f3a774448
MD5 b5ee4ddc82075bb6f049295122fec5f6
BLAKE2b-256 d508663f5c79acf88aa28c298d5db2875af98367a495ed05976c81b72ddfe8c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidobj-0.1.5.tar.gz:

Publisher: release.yml on evopen/python-rapidobj

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rapidobj-0.1.5-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: rapidobj-0.1.5-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 151.9 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rapidobj-0.1.5-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 a078bf5eeaf22a02cc67ffc3a8e3a719d692ac45522a5fb99d12ea6a1075f8c5
MD5 6249cc6ac7ad2200a3debd9c439369fd
BLAKE2b-256 e96a3d2d365b1c9f5bfc24e84734263f2bfd0b8180598a50a6e951f92ed0d39d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidobj-0.1.5-cp314-cp314-win_amd64.whl:

Publisher: release.yml on evopen/python-rapidobj

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rapidobj-0.1.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rapidobj-0.1.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 99cb894a52b92d766ef630e23961792ebb598178ce28b78ef28a47f9c7733248
MD5 7b88ca7b35d974c30a112f60b0a52ae2
BLAKE2b-256 17ef30a4aad7fdbf32c2821e83ce90faa9eed6e35765a50d83871bf19ebcff5b

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidobj-0.1.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on evopen/python-rapidobj

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rapidobj-0.1.5-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: rapidobj-0.1.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 148.1 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rapidobj-0.1.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8bc2f36e949b47cca73b53b52abc3c2f58063d47d4f11ef21bfbe17ba13b85c3
MD5 da18a6fed78a9462500cf09a11945189
BLAKE2b-256 1fcbeb3c98328ff0c92befbe442aa3ca41ab30ba5535bc74990913bf9efab99e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidobj-0.1.5-cp313-cp313-win_amd64.whl:

Publisher: release.yml on evopen/python-rapidobj

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rapidobj-0.1.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rapidobj-0.1.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3e039acb981c7914e3e2e07c9b5b70f2a633fd55b32e08f04a9f86800b742943
MD5 d06beb583fd824c59a9390989a7b80f2
BLAKE2b-256 b11b6fbe55638d57c6b826d32fd35c33deed1d8de6339ca21212cfd2174d0f09

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidobj-0.1.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on evopen/python-rapidobj

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rapidobj-0.1.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: rapidobj-0.1.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 148.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rapidobj-0.1.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 eb29407cdc8c57677ba7a53382bd0099143c675f7424fbd310f35e82b15f0c35
MD5 e4b6c5603aa57b8b0a45b5b7bb1cf066
BLAKE2b-256 bdd3f0ee42815866803c7db3008a48e5153d0792a47cdb1d4e33e71bf45a5574

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidobj-0.1.5-cp312-cp312-win_amd64.whl:

Publisher: release.yml on evopen/python-rapidobj

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rapidobj-0.1.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rapidobj-0.1.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8fab4d463c577edb5a29e1b23ca2e115fdae304435c67e9383ad963b3793db79
MD5 ad53f659e3157576d462adeac56855b2
BLAKE2b-256 df88ef75808555d26b11a8174707a522e4061d41fb0a227b7120db1a20e4d680

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidobj-0.1.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on evopen/python-rapidobj

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page