This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 1.0.5 instead.
Reason given by maintainers: imports broken
ocp-viewer-core
The shared half of the OCP viewer ecosystem: one show suite, one tessellation, one set of config semantics, used by four viewers that each keep their own transport and their own settings storage.
- ocp_vscode — the VS Code extension and its Python client
- ocp_viewer — the standalone viewer,
python -m ocp_viewer - Jupyter CadQuery — through cad-viewer-widget
- build123d Studio
Published as one project under one version to two registries: ocp-viewer-core on PyPI for the Python half, ocp-viewer-core on npm for the JavaScript half. The two are shipped and versioned together, so which version of the pair a host has is one question rather than two.
The idea
Each host provides a Comms — a Python encoder and a JavaScript decoder, shipped as a pair — and a settings source. Everything above that is shared and knows nothing about which host it is running in. No host is nameable inside this package: no port=/viewer= pairs, no is_jupyter_cadquery, no environment sniffing, and no host name in a string. A conformance kit enforces that by running the shared half end to end over an in-memory loopback with no host at all.
Per-host imports stay per host: from ocp_vscode import show beside from build123d_studio import show. A single universal import with the host discovered at runtime is deliberately not offered — it is how a show() once silently drew into somebody else's viewer.
Status
Early development. Nothing here is published, and the API changes without notice until the first host adopts it.
Layout
| path | what |
|---|---|
ocp_viewer_core/ |
the Python half |
ocp_viewer_core/config.py |
the config keys, each mapped to the name three-cad-viewer knows it by, and the precedence over them |
ocp_viewer_core/comms.py |
the transport a host implements, and the session that caches what it answers |
ocp_viewer_core/logo.py |
the splash logo as measurable geometry, for a host's measurement backend |
js/src/logo.js |
the splash logo as tessellated data plus its config, for the renderer |
js/ |
the JavaScript half, published to npm |
tests/ |
including the conformance kit |
ocp_viewer_core/__init__.py is import-free by design: hosts import the submodule they need, so that importing the package never pulls in the tessellator or OCP.
Use
ocp vscode:
A host writes one class and supplies one list. exclude_keys names the keywords
it may not be told, because its surface decides them - the show signature is the
superset of every host's, so a keyword one host owns is a keyword another has to
refuse by name rather than ignore.
comms = MyComms()
session = Session(comms) # sets session cache to None
config = Config(session, ("cad_width", "height"))
show(objects)
What a host persists between sessions is its own business and needs no key
list here: it answers with values, from Comms.workspace_config(). Which of the
viewer's reported state counts as configuration - and so survives into the next
show - is keys.CONFIG, derived from the vocabulary, because that set is a
property of three-cad-viewer's state and not of any host's settings.
Dependencies
ocp-tessellate for tessellation, and three-cad-viewer as a peer dependency of the JavaScript half. No OCP provider is declared — the same OCP namespace is supplied by cadquery_ocp, cadquery_ocp_novtk and conda's OCP, and naming one would break users of the other two. The host or the user chooses.
Licence
Apache-2.0.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file ocp_viewer_core-1.0.0.tar.gz.
File metadata
- Download URL: ocp_viewer_core-1.0.0.tar.gz
- Upload date:
- Size: 103.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
249a4a527700577739c4a719136adb91ec791ca39f3328e97bfde90d0d950ec2
|
|
| MD5 |
6e1d2efeaf3e0ec12999dd1dc0dc74e6
|
|
| BLAKE2b-256 |
13badf2c210b6be19644d9f514a0890eae1e0cd84b95464ec2b2e7eed002adde
|
File details
Details for the file ocp_viewer_core-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ocp_viewer_core-1.0.0-py3-none-any.whl
- Upload date:
- Size: 105.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2781ff3d98ef5906b777dfadb80f4240c57136b22600648d3ab098046f0c43d
|
|
| MD5 |
d50a4f367b84d476a4c0f9ace1384edb
|
|
| BLAKE2b-256 |
90c4658b1c434b4c7ab0a282b22a0cdc7a506f9039ca06e74f5bc31c54d18972
|