Skip to content

Campus API Python

Python SDK for the NYJC Campus school platform: one client for the Campus API (assignments, circles, files, hosted apps, submissions, timetable), Campus Auth (OAuth, login sessions, clients, grants, vaults), Campus Audit (traces, API keys), and the first-party integrations registry.

from campus_python import Campus

campus = Campus()                      # server mode (CLIENT_ID/CLIENT_SECRET)

for assignment in campus.api.assignments.list():
    print(assignment.title)

with campus.with_user_session():       # acting as the logged-in user
    campus.api.circles["circle_ab12cd34"].members.add("user_jane", 15)

Why it looks like this

  • One facade, four service roots. campus.api, campus.auth, campus.audit, and campus.integrations each resolve their own base URL from the environment and carry their own resource tree.
  • Resources are addressable objects. campus.api.circles["circle_ab12cd34"] is a resource you can .get(), .update(), .delete() — and drill into (members, entries, responses, ...). See the Campus API reference.
  • Framework-free. The SDK holds no web-framework dependency and no request state. Flask apps join it through the campus.flask_campus middleware via two injectable seams — see Authentication and Tracing.
  • Errors are typed by status. Every non-2xx response raises an APIError subclass (NotFoundError, ValidationError with field details, ...). See Errors.

Where to go next

If you want to... Read
install and make a first call Getting started
authenticate (server, device, user sessions) Authentication
attribute calls to journeys/deployments in audit Tracing
run the SDK against your own transport Custom clients
add a resource or endpoint Extending the SDK
look up any method Reference