OpenSKP — Python Package
Open-source SketchUp (.skp) binary file parser. Extract geometry, metadata,
layers, and materials from SketchUp files without requiring SketchUp itself.
Installation
pip install openskp
Or install from source:
git clone https://github.com/iamahsanmehmood/openskp.git
cd openskp/packages/python
pip install -e .
Quick Start
from openskp import SkpFile
# Parse an SKP file
skp = SkpFile.open("model.skp")
model = skp.parse()
# Inspect layers
for layer in model.layers:
print(f"{layer.name}: rgb({layer.color_r}, {layer.color_g}, {layer.color_b})")
# Inspect definitions (component geometry)
for defn in model.definitions.values():
print(f"{defn.name}: {len(defn.faces)} faces, {len(defn.vertices)} vertices")
# Inspect resolved, world-space scene hierarchy (opt-in, heavier)
scene = skp.build_scene()
for inst in scene.scene_hierarchy.children:
print(f" {inst.name} [{inst.layer}] @ {inst.position_mm}")
Exporting
from openskp.export import glb, obj, json_export
# Export to GLB (glTF 2.0 binary) - takes the SkpFile itself
glb.export(skp, "output.glb")
# Export to Wavefront OBJ - takes a built Scene, not the raw model
obj.export(scene, "output.obj")
# Export metadata as JSON - pass scene= to include the resolved hierarchy
meta = json_export.to_dict(model, scene=scene)
json_export.export(model, "output.json", scene=scene)
Package Structure
| Module | Purpose |
|---|---|
openskp.parser |
TLV binary parser for SketchUp's internal format |
openskp.model |
Dataclasses for geometry, layers, materials |
openskp.vff |
VFF/ZIP container handling |
openskp.geometry |
Geometry extraction from parsed nodes |
openskp.triangulator |
3D planar polygon triangulation |
openskp.materials |
Material and layer XML parsing |
openskp.metadata |
Dynamic properties and scene hierarchy |
openskp.transforms |
3D matrix transforms and coordinate conversion |
openskp.export |
GLB, OBJ, and JSON exporters |
Requirements
- Python ≥ 3.9
- NumPy ≥ 1.20
- Trimesh ≥ 3.0
- Shapely ≥ 1.8
License
MIT — see the root repository for full documentation and multi-language packages.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
openskp-0.3.0.tar.gz
(62.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
openskp-0.3.0-py3-none-any.whl
(57.7 kB
view details)
File details
Details for the file openskp-0.3.0.tar.gz.
File metadata
- Download URL: openskp-0.3.0.tar.gz
- Upload date:
- Size: 62.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23ec3e12c8706f63b18476dfa6125ce8253db80d6d1c81ba7e0c031a8f8cf2f9
|
|
| MD5 |
73aae519051c920b8d7093e71aa93bdf
|
|
| BLAKE2b-256 |
a91845542cc5dd3a32a44436e9ac180e65190942a9663ec943bc3b01f68d16c4
|
File details
Details for the file openskp-0.3.0-py3-none-any.whl.
File metadata
- Download URL: openskp-0.3.0-py3-none-any.whl
- Upload date:
- Size: 57.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4275a688ab769a552d9bd75d6fd2ac505edd952e2ba2a121706d7bcda84fca0c
|
|
| MD5 |
c710e818592986b0560b633d618ed4fc
|
|
| BLAKE2b-256 |
c5d2da253f571338692177be13075666e1660a25664391224a4b2e5e60c24c0a
|