Skip to main content

Gemini Program Platform client.

Project description

GPP Client

Run Tests Docs Status


Pain-free python/CLI communication with the Gemini Program Platform (GPP).

Documentation: https://gpp-client.readthedocs.io/en/latest/

Source Code: https://github.com/gemini-hlsw/gpp-client


Python client and CLI for the GPP. Key features:

  • Type‑safe GraphQL
    • Pydantic models from the GPP GraphQL schema, so every query, mutation, and input type is validated.
  • Resource Managers
    • High‑level Manager classes (e.g. GPPClient.program, GPPClient.observation) with convenient get_by_id, get_all, create, update_by_id, delete_by_id, restore_by_id and more methods, no need to write raw GraphQL.
  • Flexible payloads
    • Create or update via in‑memory Pydantic inputs or from_json files.
  • gpp CLI
    • Full CRUD surface on the command line: gpp <resource> list|get|create|update|delete, with rich table output and JSON export options.

Requirements

  • python>=3.10
  • toml
  • typer
  • ariadne-codegen

Development Status

🚧 Alpha: the library is under heavy development. The public API and CLI flags may change between releases.

Installation

pip install gpp-client

Quickstart

from gpp_client import GPPClient

# Initialize with your GraphQL endpoint and credentials.
client = GPPClient(url="YOUR_URL", token="YOUR_TOKEN")

# List the first 5 program notes.
notes = await client.program_note.get_all(limit=5)
for note in notes["matches"]:
    print(f"{note['id']}: {note['title']}")

# Create a new note from a JSON file.
new_note = await client.program_note.create(
    from_json="path/to/program_note_payload.json",
    program_id="p-123"
)
print("Created:", new_note)

# Or create a note from the pydantic model.
from gpp_client.api.enums import Existence
from gpp_client.api.input_types import ProgramNotePropertiesInput

properties = ProgramNotePropertiesInput(
    title="Example",
    text="This is an example.",
    is_private=False,
    existence=Existence.PRESENT
)
another_note = await client.program_note.create(properties=properties, program_id="p-123")

print("Created another:", another_note)

As a CLI

# Get help.
gpp --help

# Get observation help.
gpp obs --help

# List observations.
gpp obs list --limit 3

# Get details for one.
gpp obs get o-123

# Create via JSON.
gpp obs create --from-json new_obs.json --program-id p-123

# Update by ID via JSON.
gpp obs update --observation-id o-123 --from-json updated_obs.json

Reporting Bugs and Feature Requests

Jira: https://noirlab.atlassian.net/jira/software/projects/GPC/boards/162

NOIRLab Slack channel: #gpp-client

While in heavy development, please file requests or report bugs via our Jira board or Slack channel.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpp_client-25.5.0a0.tar.gz (77.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpp_client-25.5.0a0-py3-none-any.whl (92.7 kB view details)

Uploaded Python 3

File details

Details for the file gpp_client-25.5.0a0.tar.gz.

File metadata

  • Download URL: gpp_client-25.5.0a0.tar.gz
  • Upload date:
  • Size: 77.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for gpp_client-25.5.0a0.tar.gz
Algorithm Hash digest
SHA256 e5300c7337ace0d0b13404f55807b95bce05e8e34af319025eba8c00650b6a7a
MD5 ba7b5f53937f1c2cede85e0e0b00afbb
BLAKE2b-256 0b450fb2c7fe2380b79b074bc991caed9cec9fb556b47504e4a15841fed3fc1d

See more details on using hashes here.

File details

Details for the file gpp_client-25.5.0a0-py3-none-any.whl.

File metadata

  • Download URL: gpp_client-25.5.0a0-py3-none-any.whl
  • Upload date:
  • Size: 92.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for gpp_client-25.5.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 74e0f32811f344531291e56900c08020c9172e06f6b579b42b82a4a08e39bec9
MD5 89379a40ded9b231c023a9572ece44c3
BLAKE2b-256 db4d7d2516f8a2a8b08e6540ed93af36908fc493b6713a232791ad728f696793

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page