Google 上校 API
Google Colab API
是否有 Google Colab API?我希望完成类似的事情:
- 创建用户
- 创建笔记本
- 与用户共享笔记本
- 检索笔记本的内容
Google Colab 笔记本就像 Google 云端硬盘中的普通文件。
因此,您可以使用云端硬盘 API 像管理任何云端硬盘文件一样管理它们。
例如,您可以使用 Drive REST API 共享笔记本,如此处所述
正如其他答案中所指出的,Colab 笔记本是您 Google 驱动器上的文件。因此,可以通过 Google Drive API (from what I understand you can use the webContentLink 下载它们来共享它们或检索它们的内容。
但是,您的第一个问题是:
Google Colab API 在哪里?
对于从 Google 来到这里试图找到官方 Google Colab API 的任何人(因为它是目前谷歌搜索的最佳结果之一),这里是答案:
[截至 2020 年夏季] 由于这只是一个研究项目,因此没有官方 API 文档,因此某些信息可能很难获得。
你最好的选择是去 Official Github Repository:
代码中的API
- Github:
google.colab
- Github:
google.colab.drive
- Github:
google.colab.drive.mount
(在很多片段中使用)
- Github:
google.colab.files
(提供 download
和 upload
实用程序)
- Github:
google.colab.snippets
(以编程方式将片段添加到片段列表;仅供参考:您可以通过转至 Insert
-> Snippets
) 找到所有片段
- Github:
all packages
更多文档 + 注释
常见问题解答解释了一些内部机制。亮点包括:
It’s a Jupyter notebook environment that requires no setup to use.
方便!
我衷心推荐查看 Official Feature Demo; it's how I found out that it even supports LaTeX and MathJax! (but then again that might not come as news to someone with experience in Jupyter)
虚拟机
常见问题解答还提到...
Code is executed in a virtual machine dedicated to your account. Virtual machines are recycled when idle for a while, and have a maximum lifetime enforced by the system.
这就是为什么您可以执行各种常见的系统调用(例如 !pip install
、open
等)并且它正常工作的原因。
然而这也是为什么当你第二天回来时...
drive.mount
再次请求您的许可
- 您必须重新安装所有软件包
- 任何新创建的文件都消失了(除非你把它们放在驱动器安装的文件夹中)
是否有 Google Colab API?我希望完成类似的事情:
- 创建用户
- 创建笔记本
- 与用户共享笔记本
- 检索笔记本的内容
Google Colab 笔记本就像 Google 云端硬盘中的普通文件。
因此,您可以使用云端硬盘 API 像管理任何云端硬盘文件一样管理它们。
例如,您可以使用 Drive REST API 共享笔记本,如此处所述
正如其他答案中所指出的,Colab 笔记本是您 Google 驱动器上的文件。因此,可以通过 Google Drive API (from what I understand you can use the webContentLink 下载它们来共享它们或检索它们的内容。
但是,您的第一个问题是:
Google Colab API 在哪里?
对于从 Google 来到这里试图找到官方 Google Colab API 的任何人(因为它是目前谷歌搜索的最佳结果之一),这里是答案:
[截至 2020 年夏季] 由于这只是一个研究项目,因此没有官方 API 文档,因此某些信息可能很难获得。
你最好的选择是去 Official Github Repository:
代码中的API
- Github:
google.colab
- Github:
google.colab.drive
- Github:
google.colab.drive.mount
(在很多片段中使用) - Github:
google.colab.files
(提供download
和upload
实用程序) - Github:
google.colab.snippets
(以编程方式将片段添加到片段列表;仅供参考:您可以通过转至Insert
->Snippets
) 找到所有片段
- Github:
all packages
更多文档 + 注释
常见问题解答解释了一些内部机制。亮点包括:
It’s a Jupyter notebook environment that requires no setup to use.
方便!
我衷心推荐查看 Official Feature Demo; it's how I found out that it even supports LaTeX and MathJax! (but then again that might not come as news to someone with experience in Jupyter)
虚拟机
常见问题解答还提到...
Code is executed in a virtual machine dedicated to your account. Virtual machines are recycled when idle for a while, and have a maximum lifetime enforced by the system.
这就是为什么您可以执行各种常见的系统调用(例如 !pip install
、open
等)并且它正常工作的原因。
然而这也是为什么当你第二天回来时...
drive.mount
再次请求您的许可- 您必须重新安装所有软件包
- 任何新创建的文件都消失了(除非你把它们放在驱动器安装的文件夹中)