---
title: "DracoPy | pypx"
description: "Python wrapper for Google's Draco Mesh Compression Library"
canonical_url: "https://pypx.app/packages/dracopy"
meta:
  "og:description": "Python wrapper for Google's Draco Mesh Compression Library"
  "og:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_DracoPy%2Cversion_2.2.0%2Csummary_Python%2Bwrapper%2Bfor%2BGoogle's%2BDraco%2BMesh%2BCompression%2BLibrary%2Clicense_Apache-2.0%2Cp_Ii9wYWNrYWdlcy9kcmFjb3B5Ig%2Cs_1bH5QybPhJPqllfj.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "DracoPy 2.2.0"
  "twitter:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_DracoPy%2Cversion_2.2.0%2Csummary_Python%2Bwrapper%2Bfor%2BGoogle's%2BDraco%2BMesh%2BCompression%2BLibrary%2Clicense_Apache-2.0%2Cp_Ii9wYWNrYWdlcy9kcmFjb3B5Ig%2Cs_1bH5QybPhJPqllfj.png"
---

> Index of every page on this site: [llms.txt](https://pypx.app/llms.txt)

# **DracoPy**

v2.2.0

Python wrapper for Google's Draco Mesh Compression Library

2.5 MBplatform-specificApache-2.0

[** Diff **](https://pypx.app/packages/DracoPy/diff)

`$ uv add DracoPy`

[![PyPI version](https://badge.fury.io/py/DracoPy.svg)](https://badge.fury.io/py/DracoPy)

# DracoPy

```
import os
import DracoPy

with open('bunny.drc', 'rb') as draco_file:
  mesh = DracoPy.decode(draco_file.read())

print(f"number of points: {len(mesh.points)}")
print(f"number of faces: {len(mesh.faces)}")
print(f"number of normals: {len(mesh.normals)}")

# Note: If mesh.points is an integer numpy array,
# it will be encoded as an integer attribute. Otherwise,
# it will be encoded as floating point.
binary = DracoPy.encode(mesh.points, mesh.faces)
with open('bunny_test.drc', 'wb') as test_file:
  test_file.write(encoding_test)

# If faces is omitted, DracoPy will encode a point cloud
binary = Dracopy.encode(mesh.points)

# Options for encoding:
binary = Dracopy.encode(
  mesh.points, faces=mesh.faces,
  quantization_bits=14, compression_level=1,
  quantization_range=-1, quantization_origin=None,
  create_metadata=False, preserve_order=False,
  colors=mesh.colors
)

```

DracoPy is a Python wrapper for Google's Draco mesh compression library.

## Installation

Binary wheels are available for users with Python >= 3.6 and pip >= 20.

Installation from source requires Python >= 3.6, pip >= 10, and a C++ compiler that is fully compatible with C++11.

It supports Linux, OS X, and Windows. Numpy is required.

```
pip install DracoPy
```

## Acknowledgements

We graciously thank The Stanford 3D Scanning Repository for providing the Stanford Bunny test model.

https://graphics.stanford.edu/data/3Dscanrep/

## **Details **

<dl>

<dt>Version</dt>
<dd>2.2.0</dd>

<dt>License</dt>
<dd>Apache-2.0</dd>

<dt>Maintainer</dt>
<dd>Manuel Castro, William Silversmith :: Contributors :: Fatih Erol, Faru Nuri Sonmez, Forrest Collman, Zeyu Zhao, Denis Riviere, Brett Tully, Hanseul Jun, Afshawn Lotfi, Pan Xinmiao, Kenneth Bongort, Ed Schmerling, Philipp Schlegel, Aidan Newsome</dd></dl>

## **Links**

- [Homepage](https://github.com/seung-lab/DracoPy)
- [View on PyPI](https://pypi.org/project/DracoPy/)

## **Release Cadence **

**2**

releases in the past year

avg 96 days between releases

## **Platforms **

linuxarm64mac-x86mac-armwinmusl

## **Maintainers **

- Manuel Castro · [macastro@princeton.edu](mailto:macastro@princeton.edu)
- William Silversmith :: Contributors :: Fatih Erol · [ws9@princeton.edu](mailto:ws9@princeton.edu)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://pypx.app/#website","@type":"WebSite","description":"The Python Package Index, reimagined. Fast search, dependency insights, download trends, and changelogs — all in one place.","name":"pypx","url":"https://pypx.app/"},{"@id":"https://pypx.app/packages/dracopy#webpage","@type":"WebPage","description":"Python wrapper for Google's Draco Mesh Compression Library","name":"DracoPy","url":"https://pypx.app/packages/dracopy","isPartOf":{"@id":"https://pypx.app/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://pypx.app/packages/dracopy"]}]},{"@id":"https://pypx.app/packages/dracopy#/schema/software-application/1","@type":"SoftwareApplication","applicationCategory":"DeveloperApplication","description":"Python wrapper for Google's Draco Mesh Compression Library","license":"Apache-2.0","name":"DracoPy","softwareVersion":"2.2.0"}]}
```

## Sitemap

See the full [sitemap](https://pypx.app/sitemap.md) for all pages.
