Working with Python ORDS API for OML

To use Python ORDS API for OML, install using pip ords_python-1.0.0-py3-none-any.whl.

We have covered the steps of Python installation in the previous section.

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.

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

url: This specifies ORDS host and port including protocol (http or https).

username:This specifies the schema name.

password:This specifies the password to the schema.

Login using Simple Oracle Document Access (SODA) for Oracle Machine Learning (OML). SODA allows connecting to ORDS via OAuth2 protocol. If the Oracle Machine Learning (OML) package is installed in Python, enter the following command to login:
import adp
    ords = 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:
  • Analytics
  • Ingest
  • Insight
  • Miscellaneous

Refer to the following functions in the subsequent chapter.