{"id":45035,"library":"graphdatascience","title":"Neo4j Graph Data Science Client","description":"A Python client for the Neo4j Graph Data Science (GDS) library, enabling users to run graph algorithms and manage graph projections directly from Python. Current version is 1.22, requiring Python >=3.10. The library is actively maintained with regular releases aligned with GDS server versions.","status":"active","version":"1.22","language":"python","source_language":"en","source_url":"https://github.com/neo4j/graph-data-science-client","tags":["neo4j","graph","gds","graph-data-science","algorithms"],"install":[{"cmd":"pip install graphdatascience","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"Required for database connectivity","package":"neo4j","optional":true}],"imports":[{"note":"In v1.x, the main class is exposed at the package level.","wrong":"from graphdatascience.client import GraphDataScience","symbol":"GraphDataScience","correct":"from graphdatascience import GraphDataScience"}],"quickstart":{"code":"import os\nfrom graphdatascience import GraphDataScience\n\nURI = os.environ.get('NEO4J_URI', 'bolt://localhost:7687')\nAUTH = (os.environ.get('NEO4J_USER', 'neo4j'), os.environ.get('NEO4J_PASSWORD', 'password'))\n\ngds = GraphDataScience(URI, auth=AUTH)\n\n# Run a simple algorithm\nresult = gds.run_cypher(\"RETURN gds.version() AS version\")\nprint(result)\n\ngds.close()","lang":"python","description":"Connects to a Neo4j database and retrieves the GDS library version."},"warnings":[{"fix":"Upgrade Python to 3.10 or later before installing current versions.","message":"The 'graphdatascience' package dropped support for Python 3.7 and 3.8 in v1.0. Python 3.9 was deprecated in v1.14 and removed in v1.17. Ensure your environment uses Python >=3.10.","severity":"breaking","affected_versions":">=1.0"},{"fix":"Use `Auth(('neo4j', password))` or set `gds.auth = ('neo4j', password)` after creation.","message":"The `GraphDataScience` constructor no longer supports the `auth` parameter as a tuple; pass it as a `neo4j.Auth` object or use the `gds.auth` property. The tuple form still works but is deprecated.","severity":"deprecated","affected_versions":">=1.18"},{"fix":"Use context manager: `with GraphDataScience(...) as gds: ...` or ensure `.close()` is called in a `finally` block.","message":"Always call `gds.close()` to release connections. Forgetting this can cause resource leaks and connection exhaustion.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `yield` or cursor-based iteration if available, or apply LIMIT in your Cypher query.","message":"When using `gds.run_cypher()` with queries that return large results, the client may hold all data in memory. For large graph projections, use streaming or limit results.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.22':33 '3.10':36 'activ':40 'algorithm':22,57 'align':45 'client':5,8 'current':30 'data':3,13,55 'direct':27 'enabl':17 'gds':15,47,52 'graph':2,12,21,25,51,54 'graph-data-sci':53 'librari':16,38 'maintain':41 'manag':24 'neo4j':1,11,50 'project':26 'python':7,29,35 'regular':43 'releas':44 'requir':34 'run':20 'scienc':4,14,56 'server':48 'user':18 'version':31,49","created_at":"2026-06-07T12:53:03.043788+00:00","updated_at":"2026-06-07T12:53:03.043788+00:00","problems":[{"fix":"Use `from graphdatascience import GraphDataScience` (or `GraphDataScience` is a top-level class).","cause":"Incorrect import path; GraphDataScience is not a direct attribute in older versions or submodules.","error":"AttributeError: module 'graphdatascience' has no attribute 'GraphDataScience'"},{"fix":"Ensure Neo4j is started and accessible at the URI. Check firewall and port 7687 (default).","cause":"Neo4j server is not running, URI is wrong, or port is blocked.","error":"neo4j.exceptions.ServiceUnavailable: Failed to establish connection to ..."},{"fix":"Use `auth=('neo4j', 'password')` or `auth=Auth(('neo4j', 'password'))`.","cause":"Passing `auth` as a single string or incorrect format.","error":"ValueError: authentication credentials must be a tuple or an Auth object"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/neo4j/graph-data-science-client","github":"https://github.com/neo4j/graph-data-science-client","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}