使用适用于 Autonomous Database 的 Python Data Studio API
Python Data Studio API 程序包在 OML 记事本中和作为独立应用程序运行。
您可以查看 Oracle Autonomous Database 上托管的 REST API 端点。通过这些端点,您可以存储机器学习模型及其元数据,并为模型创建评分端点。
安装 Python Data Studio API
从 PyPI 安装基本程序包:
pip install oracle-data-studio基本安装包括 Autonomous Database (adp)、Essbase (essbase) 和 Data Transforms (datatransforms) 客户端。可选功能安装为额外功能:
pip install "oracle-data-studio[mcp]" # MCP server
pip install "oracle-data-studio[agents]" # A2A agent runtime
pip install "oracle-data-studio[agents,openai]" # agents + OpenAI model adapter
pip install "oracle-data-studio[agents,anthropic]" # agents + Anthropic model adapter
pip install "oracle-data-studio[oracle]" # Oracle-DB-backed durable agent store
pip install "oracle-data-studio[redis]" # Redis-backed durable agent store连接到自治数据库
要通过您的用户名和密码连接到 Autonomous Database,请运行以下命令:
import adp
adp_instance = adp.login('<url>', '<username>', '<password>')以下是参数及其说明:url:此项指定 Database Actions 主机。例如,https://abcdefg.oraclecloudapps.com 。
username:此项指定方案名称。
password:此项指定方案的密码。
在 OML Notebooks 中连接
通过输入以下命令在 OML 记事本中登录:
import adp
adp_instance = adp.connect()登录方法的返回值是包含所有自治数据平台 (Autonomous Data Platform,ADP) 函数的类实例。
Adp 类实例由以下内部类组成:
- 摄入
- 分析
- 洞察
- 其他
- 数据共享
请参阅下一章中的以下功能。
主题:
- 摄取函数
Adp.Ingest类用于将数据从不同源加载到表和视图中。 - Analytic View Functions(分析视图函数)
类 Adp.Analytics 为 Data Studio Suite 工具的 Analytic Views 工具提供了应用程序编程接口的类、方法、属性和参数的语法和说明。如果请求的分析视图不存在(创建除外),则所有函数都将返回消息Analytic view does not exist。 - Insight 函数
Insight 函数为 Data Studio 工具套件中的 Insight 工具提供应用程序编程接口的类、方法、属性和参数的语法和说明。生成洞察是在后台执行的,需要检查完成情况。 - 其他函数
其他函数提供应用程序编程接口的类、方法、属性和参数的语法和说明。 - 数据共享函数
Python Data Studio Application Programming Interface (API) for Data Share 函数为 Data Studio 工具套件的数据共享工具提供应用程序编程接口的类、方法、属性和参数的语法和说明。 - 目录函数
Oracle Data Studio 目录或目录是一个多目录工具,它提供了一种在当前连接的 Autonomous Database 以及各种其他连接系统中搜索数据和其他对象的方法。