-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
26 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
rdw_ingestion_tools/api/content_repo/requests/assessments.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from attrs import define | ||
from httpx import Client | ||
from pandas import DataFrame | ||
|
||
from api import concatenate | ||
|
||
from ..extensions.httpx import get_paginated | ||
|
||
|
||
@define | ||
class Assessments: | ||
"""Dedicated to the Assessments endpoint of the Content Repo API""" | ||
|
||
client: Client | ||
|
||
def get_assessments(self, max_pages: int = 5) -> DataFrame: | ||
"""Get a pandas DataFrame of Content Repo assessments. | ||
No time-based query parameters are supported by the endpoint. | ||
Full set of assessments accessible via pagination. | ||
""" | ||
|
||
url = "assessments" | ||
|
||
assessments_generator = get_paginated( | ||
client=self.client, | ||
url=url, | ||
max_pages=max_pages, | ||
) | ||
|
||
assessments = concatenate(assessments_generator) | ||
|
||
return assessments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters