# Connecting a graphdb with a Flask app

**URL:** <https://community.neo4j.com/t/connecting-a-graphdb-with-a-flask-app/38289>\
**Category:** Cypher\
**Tags:** browser, import, neo4j-desktop\
**Created:** [May 13, 2021, 7:06pm UTC](https://community.neo4j.com/t/connecting-a-graphdb-with-a-flask-app/38289 "2021-05-13T19:06:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![weviestonder](https://avatars.discourse-cdn.com/v4/letter/w/8c91f0/32.png) [@weviestonder](https://community.neo4j.com/u/weviestonder)\
**Post date:** [May 13, 2021, 7:06pm UTC](https://community.neo4j.com/t/connecting-a-graphdb-with-a-flask-app/38289/1 "2021-05-13T19:06:21Z")

</div>

I have created a database of around 5k users, each with relationships with one another. I also have a flask app, and from the app I need to be able to call certain cypher functions (centrality, shortest path, etc. with the appropriate arguments when it is required) and then display the returned shortest path, or centrality output.

I do not know how to connect to the graphdb neither how to call these functions from within the flask app, and how the data is returned after running the algorithms. I know I can use neovis.js or d3.js to visualize the graphs, but im struggling to figure out how to get the graphs in the first place.

I don't have much experience with neo4j/cypher, so any help is greatly appreciated!

---

<div class="post-metadata">

**Author:** ![david\_allen](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/david_allen/32/13090_2.png) [@david\_allen](https://community.neo4j.com/u/david_allen)\
**Post date:** [May 17, 2021, 9:13pm UTC](https://community.neo4j.com/t/connecting-a-graphdb-with-a-flask-app/38289/2 "2021-05-17T21:13:10Z")

</div>

If you want to integrate with a flask app I recommend you start with the python driver. This will let you interact with the database and issue queries, which you'll need to do a lot of to write the kind of app you're describing.

[https://neo4j.com/docs/api/python-driver/current/#quick-example](https://neo4j.com/docs/api/python-driver/current/#quick-example)

If you haven't worked with graphs before, then _even before that_, I'd recommend checking out [neo4jsandbox.com](http://neo4jsandbox.com) and working through some examples so you can see how graphs & cypher works. Ultimately what the python driver is going to let you do is connect to the database, and run cypher.
