695 B
695 B
openapi-python-client usage
Here's how to use the generated client for the BeatSaver API.
import json
import os
import logging
from datetime import datetime, timedelta
from typing import Optional, Dict, Any
from clients.beatsaver.client import Client as beatsaver_client
from clients.beatsaver.api.maps import get_maps_latest
from clients.beatsaver.models import MapDetail, GetMapsLatestSort
logging.basicConfig(
format='%(asctime)s %(levelname)s: %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
level=logging.DEBUG
)
BASE_URL = "https://api.beatsaver.com"
beatsaver_client = beatsaver_client(base_url=BASE_URL)
maps = get_maps_latest.sync(client=beatsaver_client)