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.1.0.tar.gz (3.5 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.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eyesoft_api_client-0.1.0.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

Hashes for eyesoft_api_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dbff5efa074948b3eba965de7c148f1c8e8a3a727b741d07f8c45e15d9f8905a
MD5 b5dcdf0ad9db4510ed65a05a94be6d01
BLAKE2b-256 084e4d061ee6af52b8377d97bf41a772c6f6c3c24f4a84942a959b158fbf2dd7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eyesoft_api_client-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14e5f397a23ca72cd6f54ab078bddab1950742f3a730b9fe8512ac33307b9bff
MD5 7df83c5541ed1d1a8c839a363793f944
BLAKE2b-256 54eb6c9f192b35feafeedcd729eb7775709aeb460cfae81b8762fb0fc75a6266

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