Connect to Ocient

Connect via pyocient

The Ocient Python® module pyocient supports direct connections to Ocient systems in a Command Line Interface (CLI) as well as in Python programs that follow the Python Database API Specification 2.0.

After you install pyocient, you can establish Ocient connections to run queries and commands.

Installation Walkthrough

To install and run pyocient, follow these steps.

1

Install pyocient

Install pyocient using pip.

Shell


After running the pip install, pyocient is installed in the bin directory.

Use venv to install pyocient using a virtual environment. For more information, see the Python venv documentation.

2

Start pyocient

pyocient is started from the command line with a connection string. It includes many options to configure the connection and client similar to the JDBC driver. Learn more about supported options in the Ocient Python Module: pyocient.

After installation, you can launch from a command line by typing the pyocient command.

Shell


To connect to the system database, replace the example username (example_user) and password (example_password) with your credentials, set your IP address,

The connection example assume a SQL node exists at 10.10.1.1. The example uses the default port 4050, and is set up with default self-signed certificates for TLS.

Example Response

Text


Use the command quit; to exit the pyocient CLI interface.

3

Run a query

In the pyocient CLI, you can run any SQL query supported by your database. In this example, a query is selecting rows from the system tables:

SQL


You can also run queries from the command line with the connection string:

Shell


Example Response:

Text




For more information and API reference material for pyocient, see the Ocient Python Module: pyocient page.

Updated 23 Oct 2023
Did this page help you?