1.7.2 Starting the OPG4Py Shell

Launching the OPG4Py Shell

The OPG4Py shell executables are found in /opt/oracle/graph/bin after the graph server (PGX) installation, and in <CLIENT_INSTALL_DIR>/bin after the Python client installation.

Before launching the OPG4Py shell, verify that your system meets the prerequisites explained in Prerequisites for Installing the Python Client. You can then launch the OPG4Py shell by entering the following in your terminal:

cd /opt/oracle/graph
./bin/opg4py

When the shell has started, the following command line prompt appears:

Oracle Graph Server Shell 22.2.0
>>>

If IPython is installed the following prompt will appear:

In [1]:

By default, the OPG4Py shell creates a local PGX instance, to run graph functions in the same JVM as the shell as described in Developing Applications Using Graph Server Functionality as a Library.

Command-line Options

To view the list of available command-line options, add --help to the opg4py command:

./bin/opg4py --help

To start the PyPGX shell without connecting to the graph server (PGX), use the --no_connect option as shown:

./bin/opg4py --no_connect

Starting the OPG4Py Shell on Remote Mode

The OPG4Py shell can connect to a graph server (PGX) instance that is running on another JVM (possibly on a different machine). In order to launch the OPG4Py shell in remote mode, you must specify the --base_url parameter as shown:
./bin/opg4py --base_url https://<host>:7007 --username <graphuser>
where :
  • <host>: is the server host
  • <graphuser>: is the database user

    You will be prompted for the database password.

Note:

The graph server (PGX), listens on port 7007 by default. If needed, you can configure the graph server to listen on a different port by changing the port value in the server configuration file (server.conf). See Configuring the Graph Server (PGX) for details.

When the OPG4Py shell has started, the following command line prompt appears:

Oracle Graph Server Shell 22.2.0
>>>