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.16.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.16.0
File Size Uploaded Provenance Actions
geometry_api_v2-1.16.0.tar.gz 301.2 kB Without provenance Details for geometry_api_v2-1.16.0.tar.gz

Built distribution (wheel)

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

Total release size: 800.0 kB

Release files / geometry_api_v2-1.16.0.tar.gz

Download URL geometry_api_v2-1.16.0.tar.gz
Size 301.2 kB
Tags Source
SHA-256 checksum
How to use checksums
aad1d5795fb1f8108ece3ca305d7cb8d9b23891d57b455233d02d36685f485df
BLAKE2b-256 checksum
How to use checksums
0bae8f4cf5c6113132fb6e52b67a428ab00dd234f2aa4cb450229474078651c5
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.16.0-py3-none-any.whl

Download URL geometry_api_v2-1.16.0-py3-none-any.whl
Size 498.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2e56bdae2dbd6ab0c6ced7123e9b2cc824f3cd80b04aed5b46d6aaa6a318745
BLAKE2b-256 checksum
How to use checksums
ffc1604b144dbd6c54a05e8754b1148c64ddf76397cf284a2093616eb2bbedf1
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.16.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