Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OdkCentral to use async methods #226

Closed
wants to merge 4 commits into from
Closed

Conversation

spwoodcock
Copy link
Member

@spwoodcock spwoodcock commented Jan 30, 2024

Fixes #224

  • Replaces requests with aiohttp.
  • Async methods on all classes in OdkCentral.py.
  • Requires additional work to correctly close sessions.

One idea could be to use __aenter__ and __aclose__ magic methods, with session creation (+auth) and closing set within.
Then use the class like:

async with OdkCentral() as central:
     project_details = central.createProject(...)
     ...

Reminder

  • Update fmtm submission_crud as getSubmissionMedia now returns the response content directly (instead of the response).
  • file.contents --> file
  • functions: download_submission_for_task, download_submission, get_submission_points

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency Includes a dependency change devops enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

Rewrite OdkCentral.py to be async
1 participant