Skip to main content

gpcore-py

The official Python SDK for the G-PORTAL gpcore API.

This is the Python counterpart to gpcore-go. It provides a pre-configured OIDC client and auto-generated protobuf/gRPC bindings for interacting with the gpcore API.

Installation

pip install gpcore-sdk

Usage

The following example authenticates using the client credentials flow and fetches the current user:

import grpc
from gpcore_sdk.client import APIClient
from gpcore_sdk.auth_strategies import (
    ClientCredentialsStrategy,
    CachedAuthStrategy,
)

from gpcore_sdk.protos.gpcore.api.auth.v1.rpc_pb2_grpc import AuthServiceStub
from gpcore_sdk.protos.gpcore.api.admin.v1.requests_pb2 import GetUserRequest


def main():
    auth = ClientCredentialsStrategy(
        client_id="YOUR_CLIENT_ID",
        client_secret="YOUR_CLIENT_SECRET",
    )

    client = APIClient(strategy=CachedAuthStrategy(auth, 30))
    stub = AuthServiceStub(client.channel)

    try:
        response = stub.GetUser(GetUserRequest())
        print(f"User: {response}")
    except grpc.RpcError as e:
        print(f"gRPC error: {e.code()} - {e.details()}")


if __name__ == "__main__":
    main()

Authentication Strategies

Strategy Description
ClientCredentialsStrategy OAuth2 client credentials flow. Recommended for service-to-service authentication.
UserPasswordStrategy Resource owner password flow. Requires a dedicated Keycloak OIDC client.
CachedAuthStrategy Wrapper that caches and auto-refreshes tokens from any underlying strategy.

Development

Regenerating protobuf bindings

If the API definitions have changed, regenerate the Python protobuf/gRPC code:

scripts/update_proto.sh

Local install

pip install -e .

Releasing

  1. Update the version in pyproject.toml.
  2. Commit, tag with the version number, and push the tag.
  3. The GitHub Actions workflow will build and publish to PyPI automatically.

License

This project is licensed under the Apache License 2.0.

Metadata

Release files for gpcore-sdk 0.2.3

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

Source distribution (sdist)

Source distribution for gpcore-sdk 0.2.3
File Size Uploaded Provenance Actions
gpcore_sdk-0.2.3.tar.gz 123.8 kB With provenance Details for gpcore_sdk-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gpcore-sdk 0.2.3
File Interpreter ABI Platform Actions
gpcore_sdk-0.2.3-py3-none-any.whl Python 3 none any Details for gpcore_sdk-0.2.3-py3-none-any.whl

Total release size: 362.7 kB

Release files / gpcore_sdk-0.2.3.tar.gz

Download URL gpcore_sdk-0.2.3.tar.gz
Size 123.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cc63ef6e87ccbeb0bb3af784ec83f4fbb628c0806b3cef0532fe0ea3e7966523
BLAKE2b-256 checksum
How to use checksums
27fd7de62e7fdf69c8bf88d87be6dca4c8e73100b861bb6c20d2f88a323e8058
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 8, 2026.

Transparency log

Release files / gpcore_sdk-0.2.3-py3-none-any.whl

Download URL gpcore_sdk-0.2.3-py3-none-any.whl
Size 238.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b2ffca1220d44c9a34c30ace3859454005a10ac9617479516b990ec33d2af25
BLAKE2b-256 checksum
How to use checksums
0b11db210a349b019a39635174a48cb2814ca46758c5360ccb6fa5c1871d2e86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 8, 2026.

Transparency log

Security for gpcore-sdk 0.2.3

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gpcore_sdk-0.2.3.tar.gz

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 May 8, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files Full provenance

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