Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trovares/trovares_connector
A Python client for connecting Trovares xGT to other applications.
https://github.com/trovares/trovares_connector
cypher database graph neo4j odbc python python3 trovares xgt
Last synced: 3 months ago
JSON representation
A Python client for connecting Trovares xGT to other applications.
- Host: GitHub
- URL: https://github.com/trovares/trovares_connector
- Owner: trovares
- License: apache-2.0
- Created: 2022-04-26T00:34:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-02T21:11:29.000Z (4 months ago)
- Last Synced: 2024-10-02T21:19:50.216Z (4 months ago)
- Topics: cypher, database, graph, neo4j, odbc, python, python3, trovares, xgt
- Language: Python
- Homepage: https://trovares.github.io/trovares_connector/
- Size: 7.5 MB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# trovares_connector Package
[![CI](https://github.com/trovares/trovares_connector/actions/workflows/pytest.yml/badge.svg)](https://github.com/trovares/trovares_connector/actions/workflows/pytest.yml)
[![Available on Pypi](https://img.shields.io/pypi/v/trovares_connector)](https://pypi.python.org/pypi/trovares_connector)
[![Pypi Versions](https://img.shields.io/pypi/pyversions/trovares_connector)](https://pypi.python.org/pypi/trovares_connector)
[![License](https://img.shields.io/github/license/trovares/trovares_connector)](https://github.com/trovares/trovares_connector/blob/main/LICENSE)
[![Twitter Follow](https://img.shields.io/twitter/follow/TrovaresxGT)](https://twitter.com/TrovaresxGT)This Python package is for connecting the Trovares xGT graph analytics engine to other applications.
Trovares xGT can [significantly speedup Neo4j queries](https://www.trovares.com/trovaresvneo4j).The default connector provided is for Neo4j or AuraDB.
The package also provides an optional ODBC connector for connecting to databases or applications that support ODBC.
Information about the ODBC connector can be found [in the documentation](https://trovares.github.io/trovares_connector/odbc).
Homepage:
trovares.com
Documentation:
trovares.github.io/trovares_connector
General Help:
github.com/trovares/trovares_connector/discussions
## Requirements
- [Neo4j Python](https://pypi.org/project/neo4j/)
- [xGT Python](https://pypi.org/project/xgt/)
- [Pyarrow](https://pypi.org/project/pyarrow/)
- [Trovares xGT](https://www.trovares.com)## Installation
You can install this python package by executing this command:
```bash
python -m pip install trovares_connector
```If you want to use the ODBC connector, you can install the optional dependencies like so:
```bash
python -m pip install 'trovares_connector[odbc]'
```If you don't have Trovares xGT, you can install and run the [Developer version](https://hub.docker.com/r/trovares/xgt) from Docker:
```bash
docker pull trovares/xgt
docker run --publish=4367:4367 trovares/xgt
```
## Using the trovares_connectorFrom any Python environment, simply importing both `xgt` and `trovares_connector` is all that is needed to operate this connector.
A simple example below shows connecting to Neo4j and xGT, transferring the whole graph database to xGT, running a query in xGT, and printing the results:
```python
import xgt
from trovares_connector import Neo4jConnector, Neo4jDriver# Connect to xGT and Neo4j.
xgt_server = xgt.Connection()
xgt_server.set_default_namespace('neo4j')
neo4j_server = Neo4jDriver(auth=('neo4j', 'foo'))
conn = Neo4jConnector(xgt_server, neo4j_server)# Transfer the whole graph.
conn.transfer_to_xgt()# Run the query.
query = "match(a:foo) return a"
job = xgt_server.run_job(query)# Print results.
print("Results: ")
for row in job.get_data():
print(row)
```## API
The available properties are:
- neo4j_relationship_types
- neo4j_node_labels
- neo4j_property_keys
- neo4j_node_type_properties
- neo4j_rel_type_properties
- neo4j_nodes
- neo4j_edgesThe available methods are:
- get_xgt_schemas
- create_xgt_schemas
- copy_data_to_xgt
- transfer_to_xgt
- transfer_to_neo4j## Examples
Some examples can be found here:
- [Python examples](https://github.com/trovares/trovares_connector/tree/main/examples)
- [Jupyter notebooks](https://github.com/trovares/trovares_connector/tree/main/jupyter)