-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpalmistry.py
More file actions
42 lines (33 loc) · 1.57 KB
/
palmistry.py
File metadata and controls
42 lines (33 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""Palmistry category client."""
from __future__ import annotations
from astroapi.categories.base import BaseCategoryClient
from astroapi.types.requests import (
PalmAnalysisRequest,
PalmAstroRequest,
PalmCompatibilityRequest,
PalmReadingRequest,
)
from astroapi.types.responses import GenericResponse
class PalmistryClient(BaseCategoryClient):
"""Client for palmistry endpoints."""
API_PREFIX = "/api/v3/palmistry"
def get_analysis(self, request: PalmAnalysisRequest) -> GenericResponse:
"""Get palm analysis raw data."""
url = self._build_url("analysis")
data = self._http.post(url, json=request.model_dump(exclude_none=True))
return GenericResponse(**data)
def get_reading(self, request: PalmReadingRequest) -> GenericResponse:
"""Get palm reading with interpretation."""
url = self._build_url("reading")
data = self._http.post(url, json=request.model_dump(exclude_none=True))
return GenericResponse(**data)
def get_astro_integration(self, request: PalmAstroRequest) -> GenericResponse:
"""Get palm-astrology integration."""
url = self._build_url("astro")
data = self._http.post(url, json=request.model_dump(exclude_none=True))
return GenericResponse(**data)
def get_compatibility(self, request: PalmCompatibilityRequest) -> GenericResponse:
"""Get palm compatibility analysis."""
url = self._build_url("compatibility")
data = self._http.post(url, json=request.model_dump(exclude_none=True))
return GenericResponse(**data)