Skip to main content

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


Download files

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

Source Distribution

eyesoft_api_client-0.2.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

eyesoft_api_client-0.2.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file eyesoft_api_client-0.2.0.tar.gz.

File metadata

  • Download URL: eyesoft_api_client-0.2.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.13.13 Linux/5.15.154+

File hashes

Hashes for eyesoft_api_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 542278802b619fc9f7e4d53d8a4ebd08a39efe74fde02bb46af73b9612fb3646
MD5 eceda67626c941a60d46e77738089b43
BLAKE2b-256 cf6358a7e804764c740ffbcbfe38dccb3e96a8333e8345e5f1b0a5ca48f37689

See more details on using hashes here.

File details

Details for the file eyesoft_api_client-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: eyesoft_api_client-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 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

Hashes for eyesoft_api_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93560b7c4a366283f45563baa65cb373de15ce3175d433b4c579c2f70f842bc3
MD5 430a21fa50b21fa11116df58a20c1cd9
BLAKE2b-256 f73b698cbb40dfb5fbe79e8a7964266f87fc922cc917d360871386d038b753a8

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