No project description provided
Project description
Eyesoft API Client
Python client for the Eyesoft API.
Installation
pip install eyesoft-api-client
Quick start
from eyesoft_api_client import Client
with Client(
base_url="https://api.example.com",
username="user",
password="pass",
client_id="client_id",
client_secret="client_secret",
) as client:
patients = client.list_patients()
print(patients[0].id)
Authentication
The client authenticates with the API using OAuth2 (username/password + client credentials). Tokens are managed automatically by the HTTP session.
| Parameter | Description |
|---|---|
base_url |
Root URL of the API (no trailing slash) |
username |
User account login |
password |
User account password |
client_id |
OAuth2 client ID |
client_secret |
OAuth2 client secret |
Usage
Patients
# List all patients
patients = client.list_patients()
# Fetch a single patient by UUID
patient = client.get_patient("550e8400-e29b-41d4-a716-446655440000")
# Access patient fields directly as attributes
print(patient.id, patient.name)
Exercises
# List all exercises for a patient
exercises = patient.list_exercises()
# Fetch a single exercise for a patient
exercise = patient.get_exercise("550e8400-e29b-41d4-a716-446655440001")
# Fetch raw exercise data (parsed JSON)
data = exercise.get_data()
# Or fetch exercise data directly from the client
data = client.get_exercise_data("550e8400-e29b-41d4-a716-446655440001")
Resource objects
Patient and Exercise objects proxy attribute access to the underlying API response, so any field returned by the API is accessible directly:
patient = client.get_patient("550e8400-e29b-41d4-a716-446655440000")
patient.id # any field in the JSON response
patient["name"] # dict-style access also works
Lifecycle
Use the client as a context manager (recommended) to ensure the underlying HTTP session is closed:
with Client(...) as client:
...
Or manage it manually:
client = Client(...)
try:
...
finally:
client.close()
Development
Publishing
This project uses python-semantic-release with Conventional Commits for automated versioning and publishing to PyPI via GitLab CI.
Releases are triggered automatically on every push to the default branch when the commit history contains releasable changes:
| Commit prefix | Version bump |
|---|---|
fix: ... |
Patch (0.1.0 → 0.1.1) |
feat: ... |
Minor (0.1.0 → 0.2.0) |
feat!: ... / BREAKING CHANGE: |
Major (0.1.0 → 1.0.0) |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eyesoft_api_client-0.1.1.tar.gz.
File metadata
- Download URL: eyesoft_api_client-0.1.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.4 CPython/3.13.13 Linux/5.15.154+
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d381511875fb7d4629acdf8300283a6198f72a71af7d1a328e669c983046d7d
|
|
| MD5 |
f3d3a3da6405bee02873526dcadfd854
|
|
| BLAKE2b-256 |
4bd1783e4b3ef7d3f1741036ef37837e04c19a064f1670c623c710dbc307d22a
|
File details
Details for the file eyesoft_api_client-0.1.1-py3-none-any.whl.
File metadata
- Download URL: eyesoft_api_client-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.4 CPython/3.13.13 Linux/5.15.154+
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c208f77885a6597b6f39310f40d6400f63ffdf98f995e3d947758521bd5662ae
|
|
| MD5 |
a513d6efd5e1396eb62f5fc18724d676
|
|
| BLAKE2b-256 |
a7d7903167f1f3eadedb1b874bb52541c043459d3b6944b4ccff30430b79cbd8
|