Skip to main content
Project generated with PyScaffold

geometry_api_v2

SDK to communicate with the ShapeDiver Geometry API version 2

ShapeDiver is a cloud platform for building online applications based on parametric 3D files made with Rhinoceros 3D and Grasshopper.

Using the ShapeDiver Geometry Backend API allows access to ShapeDiver models without using the ShapeDiver Viewer. This SDK provides functionality to communicate with the Geometry Backend API version 2, and includes type hints describing request and response data objects. See the API documentation for more details.

Authentication

The authentication system for the Geometry Backend API is based on ticket objects and JWT tokens, which are handled by the ShapeDiver Platform. You can obtain tickets and JWT tokens by:

An SDK for the ShapeDiver Platform API will be released soon.

When obtaining a ticket for your model from the ShapeDiver Platform, please be aware that you will need a ticket for backend access, since you are accessing the Geometry Backend API from an arbitrary client application that is not a web browser. For more details see the ShapeDiver Help Center developer settings

Base URL

The base URL to use depends on which ShapeDiver Geometry Backend System your model was uploaded to. You can find the base URL in your model’s dashboard on the ShapeDiver Platform, it is also called the model view url.

Usage - Ticket only

from shapediver.geometry_api_v2 import SdClient, Configuration, SessionApi

def init_session():
    # Please see above on how to obtain a ticket
    ticket = "8b23fae66cf535719a9ec797e390208b2003e3cfc894b7624ada2f6894515f8836a4-66303337623538322d34386"

    # Initialize the SDK client instance by providing the base URL
    client = SdClient(Configuration("https://sdeuc1.eu-central-1.shapediver.com"))

    # Initialize a new session using the ticket.
    res = SessionApi(client).create_session_by_ticket(ticket)
    print(res)

Usage - Ticket and JWT

It is possible to configure your ShapeDiver models such that JWT tokens are required to communicate with them, which provides a strong authorisation mechanism. In this case you will need to use the ShapeDiver Platform API to obtain a JWT token for your model on demand.:

from shapediver.geometry_api_v2 import SdClient, Configuration, SessionApi

def init_session():
    # Please see above on how to obtain a ticket and a JWT
    jwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikp1c3QgYSB0ZXN0IiwiaWF0IjoxNjE4OTExMjcxLCJleHAiOjE2MTg5MTQ4OTcsImp0aSI6IjYzMjA3ODE3LWJiNWQtNDY3Zi04NzRkLWM4N2EyYzAxYmZlZCJ9.S5Ps_Fx5p6aJxdBOJMBKgpf2SIlp--6kkIZU55tiqEg"
    ticket = "8b23fae66cf535719a9ec797e390208b2003e3cfc894b7624ada2f6894515f8836a4-66303337623538322d34386"

    # Initialize the SDK client instance by providing the base URL
    client = SdClient(
        Configuration("https://sdeuc1.eu-central-1.shapediver.com", access_token=jwt)
    )

    # Initialize a new session using the ticket.
    res = SessionApi(client).create_session_by_ticket(ticket)
    print(res)

Examples

Examples on how to interact with available endpoints are given in the tests folder.

Versioning

We take care to provide backwards compatibility for all older versions. However, new features might be limited to newer API versions. Therefore, we recommend always using the newest API version out there.

Support

If you have questions, please use the ShapeDiver Help Center.

You can find out more about ShapeDiver right here.

Licensing

This project is released under the MIT License.

Metadata

Release files for geometry-api-v2 1.17.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for geometry-api-v2 1.17.0
File Size Uploaded Provenance Actions
geometry_api_v2-1.17.0.tar.gz 303.6 kB Without provenance Details for geometry_api_v2-1.17.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for geometry-api-v2 1.17.0
File Interpreter ABI Platform Actions
geometry_api_v2-1.17.0-py3-none-any.whl Python 3 none any Details for geometry_api_v2-1.17.0-py3-none-any.whl

Total release size: 802.4 kB

Release files / geometry_api_v2-1.17.0.tar.gz

Download URL geometry_api_v2-1.17.0.tar.gz
Size 303.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e28ce81260c8d54505a92fd3c7fbbc0a7edcbbc59b9b26f59aec4e3083d76708
BLAKE2b-256 checksum
How to use checksums
d3d8264a34d6f77d84715fdff1128b705e01740970adcc9d63994c60cfca2dbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / geometry_api_v2-1.17.0-py3-none-any.whl

Download URL geometry_api_v2-1.17.0-py3-none-any.whl
Size 498.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
809620217cb068f6a5cec84d532fdd08429590de794eda2209be79b1d318673e
BLAKE2b-256 checksum
How to use checksums
f1ac5c5aff1d0bb4de6a0d2e7df5b2fa9480fbe2501fd9ba90eaaae5fd969121
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for geometry-api-v2 1.17.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page