GolfGlobe365 GAMP
SDKs

Python SDK

Python SDK

Official GG365 SDK for Python applications.


๐Ÿ“ฆ Installation

TerminalCode
pip install gg365-sdk # or poetry add gg365-sdk

๐Ÿš€ Quick Start

REST API

Code
from gg365 import GG365Client client = GG365Client( api_key="your-api-key-here", environment="production" # or 'staging', 'development' ) # Search courses courses = client.courses.search( country="ES", region="costa-del-sol", limit=10 ) # Check availability availability = client.teetimes.check_availability( course_id=courses[0].id, date="2025-12-15", players=2 ) # Create booking booking = client.bookings.create( course_id=courses[0].id, teetime_id=availability[0].id, players=[ { "type": "lead", "first_name": "John", "last_name": "Smith", "email": "[email protected]" } ] ) print(f"Booking created: {booking.reference}")

โ›“๏ธ Blockchain API

Code
from gg365.blockchain import GG365BlockchainClient from web3 import Web3 # Connect wallet w3 = Web3(Web3.HTTPProvider('https://api.camino.network/ext/bc/C/rpc')) account = w3.eth.account.from_key('your-private-key') blockchain = GG365BlockchainClient( network="camino", wallet=account ) # Create blockchain booking booking = blockchain.bookings.create( course_id="gg365-course-12345", teetime_id="gg365-teetime-67890", players=2, payment={ "method": "crypto", "token": "CAM", "amount": 185 }, blockchain={ "smart_contract": True, "nft_ticket": True } ) print(f"Smart Contract: {booking.blockchain.smart_contract.contract_address}") print(f"NFT Token ID: {booking.blockchain.nft_ticket.token_id}")

๐Ÿ“š API Reference

Client Configuration

Code
client = GG365Client( api_key: str, # Required: Your API key environment: str = "production", # Optional base_url: str = None, # Optional: Custom API base URL timeout: int = 30, # Optional: Request timeout (seconds) retries: int = 3, # Optional: Number of retries logger: Logger = None # Optional: Custom logger )

Courses

Code
# Search courses courses = client.courses.search(params) # Get course details course = client.courses.get(course_id) # Get course by booking code course = client.courses.get_by_code(booking_code)

Tee Times

Code
# Check availability availability = client.teetimes.check_availability(params) # Get tee time details teetime = client.teetimes.get(teetime_id)

Bookings

Code
# Create booking booking = client.bookings.create(data) # Get booking booking = client.bookings.get(booking_id) # List bookings bookings = client.bookings.list(params) # Cancel booking result = client.bookings.cancel(booking_id)

๐Ÿ”ง Advanced Usage

Error Handling

Code
from gg365.exceptions import ( GG365Error, RateLimitError, ValidationError ) try: booking = client.bookings.create(data) except RateLimitError as e: print(f"Rate limit exceeded, retry after: {e.retry_after}") except ValidationError as e: print(f"Validation errors: {e.errors}") except GG365Error as e: print(f"API error: {e.message}, code: {e.code}")

Async Support

Code
from gg365 import AsyncGG365Client async def create_booking(): async with AsyncGG365Client(api_key="your-api-key") as client: courses = await client.courses.search(country="ES") availability = await client.teetimes.check_availability( course_id=courses[0].id, date="2025-12-15", players=2 ) booking = await client.bookings.create( course_id=courses[0].id, teetime_id=availability[0].id, players=[...] ) return booking # Run async function import asyncio booking = asyncio.run(create_booking())

Webhooks

Code
from gg365.webhooks import WebhookHandler from flask import Flask, request app = Flask(__name__) webhook_handler = WebhookHandler(secret="your-webhook-secret") @app.route('/webhooks/gg365', methods=['POST']) def handle_webhook(): try: event = webhook_handler.verify( payload=request.data, signature=request.headers.get('X-GG365-Signature') ) if event.type == 'booking.confirmed': print(f"Booking confirmed: {event.data}") elif event.type == 'booking.cancelled': print(f"Booking cancelled: {event.data}") return 'OK', 200 except Exception as e: return 'Invalid signature', 400

๐Ÿ“– Examples

Django Integration

Code
# views.py from django.http import JsonResponse from gg365 import GG365Client client = GG365Client(api_key=settings.GG365_API_KEY) def search_courses(request): courses = client.courses.search( country=request.GET.get('country', 'ES') ) return JsonResponse({ 'courses': [course.to_dict() for course in courses] })

FastAPI Integration

Code
from fastapi import FastAPI, HTTPException from gg365 import AsyncGG365Client from pydantic import BaseModel app = FastAPI() client = AsyncGG365Client(api_key="your-api-key") class BookingRequest(BaseModel): course_id: str teetime_id: str players: list @app.post("/bookings") async def create_booking(booking_req: BookingRequest): try: booking = await client.bookings.create( course_id=booking_req.course_id, teetime_id=booking_req.teetime_id, players=booking_req.players ) return booking.to_dict() except Exception as e: raise HTTPException(status_code=400, detail=str(e))


Status: ๐Ÿšง SDK in development - Coming Q1 2026!

For immediate assistance, contact: [email protected]

Last modified on