feat: add OpenEdxClient for Studio home endpoints - #4
Open
Faraz32123 wants to merge 4 commits into
Open
Conversation
Faraz32123
marked this pull request as draft
June 1, 2026 13:17
Faraz32123
force-pushed
the
feat/sdk_working_implementation
branch
11 times, most recently
from
June 3, 2026 11:31
82d9a8b to
02db066
Compare
Add OpenEdxClient for Studio home/courses V4 endpoint
Faraz32123
force-pushed
the
feat/sdk_working_implementation
branch
2 times, most recently
from
June 3, 2026 11:39
daeb9f9 to
625eac4
Compare
Add OpenEdxClient for Studio home V3 endpoint
Faraz32123
force-pushed
the
feat/sdk_working_implementation
branch
from
June 3, 2026 11:43
625eac4 to
eb83442
Compare
Faraz32123
force-pushed
the
feat/sdk_working_implementation
branch
from
June 3, 2026 11:52
c7c095d to
55e3b91
Compare
Faraz32123
marked this pull request as ready for review
June 3, 2026 11:53
taimoor-ahmed-1
requested changes
Jun 3, 2026
Comment on lines
+15
to
+17
| if not response.ok: | ||
| raise ApiError(response.status_code, response.text) | ||
| return response.json() |
There was a problem hiding this comment.
Maybe we could wrap this in try-except
Comment on lines
+74
to
+76
| def _request_with_timeout(self, method, url, **kwargs): | ||
| kwargs.setdefault("timeout", self._timeout) | ||
| return requests.Session.request(self._session, method, url, **kwargs) |
There was a problem hiding this comment.
instead of patching session like this maybe we can use subclass to override request object. It will support future updates as well better.
class _TimeoutSession(requests.Session):
def __init__(self, timeout):
super().__init__()
self._timeout = timeout
def request(self, method, url, **kwargs):
kwargs.setdefault("timeout", self._timeout)
return super().request(method, url, **kwargs)
|
|
||
| def __call__(self, r): | ||
| """Attach the JWT Authorization header to the request.""" | ||
| r.headers["Authorization"] = f"JWT {self._get_token()}" |
There was a problem hiding this comment.
maybe use token_type for more robustness and default to JWT prefix if not available
Comment on lines
+10
to
+11
| from .resources.home.v3 import HomeResourceV3 | ||
| from .resources.home.v4 import HomeResourceV4 |
There was a problem hiding this comment.
client.py imports HomeResourceV3 / V4 directly from resources.home.v3 / v4; resources/init.py also re-exports them with all. We should either route everything through resources/init.py or remove the re-export.
Faraz32123
force-pushed
the
feat/sdk_working_implementation
branch
from
June 3, 2026 15:57
3f10597 to
ff7a10c
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add OpenEdxClient with HomeResource for Studio home endpoints
related PRs: