Skip to main content

A Python client for the TimeBack API (OneRoster 1.2 implementation)

Project description

Timeback

Python client for the Timeback API (OneRoster 1.2 plus adjacent services).

Installation

Using Poetry (recommended)

poetry install
poetry shell

From built wheel

poetry build
pip install dist/timeback-0.1.0-py3-none-any.whl

Configuration

Required environment variables:

  • TIMEBACK_CLIENT_ID
  • TIMEBACK_CLIENT_SECRET
  • TIMEBACK_ENVIRONMENT in {production, staging}

Optional per-service base URL overrides:

  • TIMEBACK_QTI_API_BASE_URL (defaults by environment)
  • TIMEBACK_CALIPER_API_BASE_URL (defaults by environment)

Defaults by environment:

  • production
    • OneRoster: https://api.alpha-1edtech.ai/
    • QTI: https://qti.alpha-1edtech.ai/api
    • Caliper: https://caliper.alpha-1edtech.ai
  • staging
    • OneRoster: https://api.staging.alpha-1edtech.ai/
    • QTI: https://qti-staging.alpha-1edtech.ai/api
    • Caliper: https://caliper-staging.alpha-1edtech.ai

Quick start

from timeback import Timeback

client = Timeback()
user = client.oneroster.rostering.get_user("<sourcedId>")
print(user.sourcedId, user.givenName, user.familyName)

Override QTI/Caliper base URLs explicitly:

client = Timeback(
    environment="staging",
    qti_api_base_url="https://my-qti.example.com/api",
    caliper_api_base_url="https://my-caliper.example.com",
)

# Raw HTTP clients (services can be added later)
qti_health = client.qti_http.get("/health")
caliper_status = client.caliper_http.get("/status")

Services and endpoints

  • OneRoster
    • client.oneroster.rostering.get_user(sourced_id, fields=None)

Design rules: service methods contain no business logic; each method calls a single endpoint function in timeback/services/.../endpoints/, which may import utilities from .../utils/. All endpoints/utilities return typed Pydantic models/enums from timeback/models and timeback/enums.

See docs for structure and procedures:

  • timeback/docs/coding_guidelines.md
  • timeback/docs/add_endpoint_procedure.md
  • timeback/docs/oneroster/rostering/get_user.md

Testing

Run all unit tests:

poetry run pytest -q -m "not integration"

Run integration tests (real API calls; requires network and creds):

export TIMEBACK_ENVIRONMENT=production
export TIMEBACK_CLIENT_ID=...
export TIMEBACK_CLIENT_SECRET=...
poetry run pytest -q -m integration

Development

Formatting and linting:

poetry run black .
poetry run flake8 .
poetry run mypy .

Build and publish:

poetry build
poetry publish  # requires configured credentials

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

timeback-0.1.0.tar.gz (42.7 kB view details)

Uploaded Source

Built Distribution

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

timeback-0.1.0-py3-none-any.whl (84.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: timeback-0.1.0.tar.gz
  • Upload date:
  • Size: 42.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Darwin/24.6.0

File hashes

Hashes for timeback-0.1.0.tar.gz
Algorithm Hash digest
SHA256 302844cfbaa13c1a21e23973ede6f2500131d40a58c717cf685fb01757e2d915
MD5 9c983866d2ff98e7ee081a14370ddcaf
BLAKE2b-256 7f1e98cf013dba3ed5b0abf6deb011a09d2cca8229315a38c749bf1298c57417

See more details on using hashes here.

File details

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

File metadata

  • Download URL: timeback-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 84.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Darwin/24.6.0

File hashes

Hashes for timeback-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ead5e301da9ba444a36b8ab66d7753fca721a40e8b1cab0e8d1a03f79b3e5907
MD5 a8044b2a60a19ae2850e684021514dcf
BLAKE2b-256 5ca0cf4048006e990ce546feae478c105c8266f6df7b528a0c456b266950e034

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