Registry / data / dracopy

dracopy

JSON →
library2.0.0pypypiunverified

DracoPy is a Python wrapper for Google's Draco Mesh Compression Library, enabling efficient encoding and decoding of 3D mesh data. It supports common formats like OBJ and PLY (via in-memory mesh objects). The current version is 2.0.0, with releases occurring infrequently, often coinciding with upstream Draco library updates or significant API overhauls.

pip install dracopy
INSTALL
IMPORT
SIG · DRACOPY
D
dracopy
datapythonv2.0.0
Install
2.1s avg
Import
—
Disk
24MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.910 runs
build_error
glibc
py 3.10–3.910 runs
installs and imports cleanly · install 2.1s · import 0.000s · 26MB
24MB installed
● package 24MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

encode
✓ from dracopy import encode
✗ from dracopy import encode
decode
✓ from dracopy import decode
✗ from dracopy import decode
DracoMesh
✓ from dracopy import DracoMesh
✗ from dracopy import DracoMesh

This quickstart demonstrates how to create a simple 3D mesh using NumPy arrays, encode it into Draco compressed bytes, and then decode it back into a `DracoMesh` object. It highlights the use of NumPy for mesh data, which is standard in version 2.0.0 and above.

import dracopy import numpy as np # 1. Create a dummy mesh (a simple triangle) # Vertices and faces must be NumPy arrays in DracoPy 2.0.0+ vertices = np.array([ [0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0] ], dtype=np.float32) faces = np.array([ [0, 1, 2] ], dtype=np.int32) # Create a DracoMesh object mesh_to_encode = dracopy.DracoMesh(vertices=vertices, faces=faces) # 2. Encode the mesh to Draco bytes print("Encoding mesh...") draco_bytes = dracopy.encode(mesh_to_encode, compression_level=7) print(f"Encoded bytes length: {len(draco_bytes)}") # 3. Decode the Draco bytes back to a DracoMesh print("Decoding mesh...") decoded_mesh = dracopy.decode(draco_bytes) # 4. Access decoded data (still NumPy arrays) print(f"Decoded vertices shape: {decoded_mesh.vertices.shape}") print(f"Decoded faces shape: {decoded_mesh.faces.shape}") # Optional: Verify data equality assert np.array_equal(vertices, decoded_mesh.vertices) assert np.array_equal(faces, decoded_mesh.faces) print("Encoding and decoding successful!")
Debug
Known issues
breaking`DracoMesh` attributes (`vertices`, `faces`, `normals`, `colors`, `uvs`) now strictly require NumPy arrays instead of Python lists.
fix
Ensure all mesh data passed to `DracoMesh` or assigned to its attributes are NumPy arrays. Convert existing lists using `np.array(your_list)`.
affects: 2.0.0+
breakingThe helper functions `dracopy.decode_file` and `dracopy.encode_file` have been removed.
fix
Users must now handle file I/O explicitly. Read file content into bytes before passing to `dracopy.decode()` and write `dracopy.encode()` output bytes to a file manually. For example: `with open('mesh.drc', 'rb') as f: mesh_bytes = f.read(); decoded_mesh = dracopy.decode(mesh_bytes)`.
affects: 2.0.0+
gotchaInstallation can fail if pre-compiled wheels are not available for your specific Python/OS/architecture combination, requiring local compilation.
fix
Ensure your system has the necessary build tools (e.g., C++ compiler, CMake) if wheels are not provided. Check the official GitHub repository for more specific build requirements for your platform. Consider using a common Python version (3.8-3.10) for which wheels are typically provided.
affects: All versions
deprecatedThe `vertex_features` and `face_features` parameters in the `DracoMesh` constructor have been removed.
fix
These parameters are no longer supported. If you were using them, re-evaluate how you are representing and handling custom attributes. The current `DracoMesh` structure focuses on standard mesh components (vertices, faces, normals, colors, uvs).
affects: 2.0.0+
Upgrade
Version history
2.0.0latest on PyPI · released Nov 11, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
31 hits · last 30 days
node
30
OpenAI (training)
1
Resources
dracopy — pip install dracopy · libregistry