A COMPAS extension which lets you serialize and deserialize COMPAS Data types using protobuf.
Installation
Stable releases can be installed from PyPI.
pip install compas_pb
Basic Usage
Serialize to file
from compas.geometry import Vector
from compas_pb import pb_dump
from compas_pb import pb_load
PATH = "vector.data"
vector = Vector(1.0, 2.0, 3.0)
pb_dump(vector, PATH)
loaded_vector = pb_load(PATH)
(De)serialize to bytes
from compas.geometry import Vector
from compas_pb import pb_dump_bts
from compas_pb import pb_load_bts
vector = Vector(1.0, 2.0, 3.0)
bytes_vector = pb_dump_bts(vector)
loaded_vector = pb_load_bts(bytes_vector)
Serialization of arbitrarily nested data structures
from compas.geometry import Vector
from compas.geometry import Polyline
from compas_pb import pb_dump_bts
from compas_pb import pb_load_bts
data = {
"direction": Vector(1.0, 2.0, 3.0),
"outlines":
[
Polyline([0, 0, 0], [1, 1, 1], [2, 2, 2]),
Polyline([3, 3, 3], [4, 4, 4], [5, 5, 5])
],
}
pb_data = pb_dump_bts(data)
loaded_data = pb_load_bts(pb_data)
Documentation
For further "getting started" instructions, a tutorial, examples, and an API reference, please check out the online documentation here: compas_pb docs
Issue Tracker
If you find a bug or if you have a problem with running the code, please file an issue on the Issue Tracker.
Maintainers
Releases are prepared and approved through pull requests. See RELEASING.md.
Release files for compas-pb 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| compas_pb-1.2.0.tar.gz | 46.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| compas_pb-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 84.8 kB
Release files / compas_pb-1.2.0.tar.gz
| Download URL | compas_pb-1.2.0.tar.gz |
|---|---|
| Size | 46.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
116c1bf53cc34175345b507848b29f146e2ed853a987504ae96226e51dd992f5
|
|
BLAKE2b-256 checksum How to use checksums |
2aa385f7e5d9e0a979ad3c333db2734a04a66b1951fd5294014553f6b0771b44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.
Transparency logRelease files / compas_pb-1.2.0-py3-none-any.whl
| Download URL | compas_pb-1.2.0-py3-none-any.whl |
|---|---|
| Size | 38.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
26bfbe2ea7d616d9cb9dcb3a288656778580da49159c5d75bca1955e958f9326
|
|
BLAKE2b-256 checksum How to use checksums |
e2b50714d85ba6759c1bbf0f2137b462542d33d31d077149989fb7b2cc397fba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.
Transparency log