Skip to main content

Modern Python client for the QGenda REST API

Project description

qgendapy

Modern Python client for the QGenda REST API.

Documentation: GitHub Pages Docs

Thank you to JP Jorissen for laying the foundation for this library.

Features

  • Full API coverage -- 159 methods across 23 resource groups
  • Sync + Async -- QGendaClient and AsyncQGendaClient with identical APIs
  • Resource-namespaced -- client.schedule.list(), client.staff.get(key), client.credentialing.workflows()
  • Typed models -- Dataclass responses with automatic PascalCase-to-snake_case mapping
  • OData builder -- OData().select("Name").filter("IsActive eq true")
  • 3-tier config -- Explicit args > environment variables > INI file
  • Drop-in compat -- Migration module for legacy python-qgenda users

Installation

pip install qgendapy

Quick Start

from qgendapy import QGendaClient, OData

client = QGendaClient(
    email="you@hospital.org",
    password="your-password",
    company_key="your-company-key",
)

# Get this week's schedule
schedule = client.schedule.list(start_date="2024-01-15", end_date="2024-01-21")
for entry in schedule:
    print(f"{entry.staff_f_name} {entry.staff_l_name}: {entry.task_name}")

# OData filtering
odata = OData().select("FirstName", "LastName").filter("IsActive eq true")
staff = client.staff.list(odata=odata)

Configuration

# Environment variables
export QGENDA_EMAIL="you@hospital.org"
export QGENDA_PASSWORD="your-password"
export QGENDA_COMPANY_KEY="your-company-key"
# Then just:
client = QGendaClient()

Legacy QGENDA_CONF_FILE INI format is also supported.

Async

from qgendapy import AsyncQGendaClient

async with AsyncQGendaClient() as client:
    schedule = await client.schedule.list(start_date="2024-01-15")

Migrating from python-qgenda

# Change one import:
# from qgenda.api.client import QGendaClient
from qgendapy.compat import QGendaClient

# Everything else works the same
client = QGendaClient(username="...", password="...", company_key="...")
client.authenticate()
resp = client.get_schedule(start_date="2024-01-15")
data = resp.json()

See docs/migration.md for the full migration guide.

Resources

Resource Attribute Methods
Schedule client.schedule list, audit_log, open_shifts, rotations
Staff client.staff list, get, create, update, tags, skillsets, profiles, pay_modifiers, ...
Task client.task list, create, update, locations, tags, shifts
Facility client.facility list, get, create, update, delete, staff, tags, tasks, ...
Time Event client.time_event list, create, update, delete
Daily Case client.daily_case list, create, update, delete
Request client.request list, approved
Request Limit client.request_limit CRUD + staff_quotas, task_shifts
Daily Ops client.daily configurations, rooms, patient_encounters, capacity
Credentialing client.credentialing contacts, locations, providers, privileges, records, workflows, ...
Notification client.notification CRUD + contacts
User client.user list, get, non_scheduled
+ 11 more pay, tags, profiles, company, organization, ...

Acknowledgments

Inspired by python-qgenda by JP Jorissen.

License

MIT

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

qgendapy-0.2.0.tar.gz (77.9 kB view details)

Uploaded Source

Built Distribution

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

qgendapy-0.2.0-py3-none-any.whl (40.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qgendapy-0.2.0.tar.gz
  • Upload date:
  • Size: 77.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qgendapy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 864df5a9a31f5ca32be9d65a43113a7fd805dfc4a98ccf117ac7b8ee3b0d18eb
MD5 3516729238ca1e0a5d81fc684756d909
BLAKE2b-256 3e4a90d4c0069770121b66854cb5462b869258c73ba47bcaecebc09ef55eaa1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for qgendapy-0.2.0.tar.gz:

Publisher: publish.yml on lancereinsmith/qgendapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: qgendapy-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 40.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qgendapy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e15a7d9fb03f1f61761bc260f2ef8d343f09d12560a3d4968afc72e9e27b989
MD5 6017a440c872a2a9ed399293975f6e80
BLAKE2b-256 7e8d2a74ecaeea6adf839935d92bf7af18cb4377f2b81b491334c08ff38e198b

See more details on using hashes here.

Provenance

The following attestation bundles were made for qgendapy-0.2.0-py3-none-any.whl:

Publisher: publish.yml on lancereinsmith/qgendapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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