Establishing a Connection
The objects available within our connector are accessible from the "cdata.neo4j" module. To use the module's objects directly:
- Import the module as follows:
import cdata.neo4j as mod
- To establish a connection string, call the connect() method from the connector object using an appropriate connection string, such as:
mod.connect("server=localhost;port=7474;user=neo4j;password=password;")
Connecting to Neo4j
CData Python Connector for Neo4j supports connections to self-managed Neo4j instances via the HTTP API. To connect, set the following connection properties:
- Server: The server hosting the Neo4j instance. An HTTP or HTTPS protocol prefix may be optionally prepended to the server name or address.
- Port: The port on which the Neo4j service is running. The provider connects to HTTP (7474) port by default. If connecting over HTTPS, supply the HTTPS port for the Neo4j instance specified in Server.
- User: The username of the user using the Neo4j instance.
- Password: The password of the user using the Neo4j instance.
- Database: The database to target in the Neo4j instance. Defaults to "Neo4j".