Working with Python Data Studio API for Autonomous Database

Python Data Studio API package works both in OML notebook and as a standalone application.

You can view the REST API endpoints hosted on Oracle Autonomous Database. These endpoints allow you to store Machine Learning models along with their metadata, and create scoring endpoints for the model.

Installing the Python Data Studio API

Install the base package from PyPI:

pip install oracle-data-studio

The base install includes the Autonomous Database (adp), Essbase (essbase), and Data Transforms (datatransforms) clients. Optional features are installed as extras:

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

Connecting to Autonomous Database

To connect to the Autonomous Database via your username and password, run the following command:
import adp 
adp_instance = adp.login('<url>', '<username>', '<password>')
Here are the parameters and their descriptions:

url: This specifies the Database Actions host. For example, https://abcdefg.oraclecloudapps.com.

username:This specifies the schema name.

password:This specifies the password to the schema.

Connecting inside OML Notebooks

Login inside OML notebooks by entering the following command:
import adp
adp_instance = adp.connect()

The return value of the login method is an instance of class that contains all Autonomous Data Platform (ADP) functions.

The Adp class instance consists of the following inner classes:
  • Ingest
  • Analytics
  • Insight
  • Miscellaneous
  • Data Share

Refer to the following functions in the subsequent chapter.

Topics: