MCPcopy Create free account
hub / github.com/Kaggle/docker-python / UserSessionClient

Class UserSessionClient

patches/kaggle_session.py:10–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9
10class UserSessionClient():
11 GET_SOURCE_ENDPOINT = '/requests/GetKernelRunSourceForCaipRequest'
12
13 def __init__(self):
14 self.web_client = KaggleWebClient()
15
16 def get_exportable_ipynb(self):
17 """Fetch the .ipynb source of the current notebook session.
18
19 If Kaggle datasets are attached to the notebook, the source will
20 include an additonnal cell with logic to download the datasets
21 outside the Kaggle platform.
22 """
23 request_body = {
24 'UseDraft': True,
25 }
26 return self.web_client.make_post_request(request_body, self.GET_SOURCE_ENDPOINT)

Callers 2

test_no_token_failsMethod · 0.90
call_get_ipynbMethod · 0.90

Calls

no outgoing calls

Tested by 2

test_no_token_failsMethod · 0.72
call_get_ipynbMethod · 0.72