Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Latest commit

 

History

History
42 lines (29 loc) · 1.36 KB

README.md

File metadata and controls

42 lines (29 loc) · 1.36 KB

py2gds

PyPI codecov DeepSource

WIP.

Library to build Neo4j queries with special attention on Graph Data Science library calls.

It provides a DSL to write queries inspired in IGQL.

Example

from py2gds.connection import Neo4JDriverConnection
from py2gds.dsl import Query
from py2gds.algorithm import AlgorithmType

graph_connection = Neo4JDriverConnection.create(
        uri=f"{app_config.neo4j.scheme}://{app_config.neo4j.host}:{app_config.neo4j.port}",
        user=app_config.neo4.user,
        password=app_config.neo4j.password,
    )

pages_rank = (Query.using(graph_connection)
.rank(algorithm=AlgorithmType.ArticleRank)
.projected_by(labels=("Page",), relationships=("LINKS",))
.run(log=True)
)
print(pages_rank)

Install

pip install py2gds

Alternatives

If you want to write queries in Python like cypher's queries, better try: https://github.com/stellasia/pygds