Neo4j with Python [Upload data into Neo4j with Python]

Поділитися
Вставка
  • Опубліковано 22 лип 2024
  • Learn how to use Python to upload data into a Neo4j graph database.
    GIT repo with Jupyter notebook:
    github.com/discover-python/PY...
    Neo4j python library documentation:
    neo4j.com/docs/api/python-dri...
    0:00 Introduction
    0:24 Create Database
    1:00 Create fictional transactions
    3:55 Upload to MariaDB (optional)
    4:08 Write to Neo4j

КОМЕНТАРІ • 28

  • @fernandomtz8177
    @fernandomtz8177 2 роки тому +6

    Dude you are a life saver. I HAD no idea where to start manipulating a data base outside of their workbench but you made it look easy!
    Thank you so much for this video!

  • @zappandy
    @zappandy 2 роки тому +4

    Thank you so much!
    There aren't enough good concise neo4j video tutorials on youtube. I hope you can make some more in the future if you ever have some time and feel like it.

    • @discoverpython9614
      @discoverpython9614  2 роки тому

      No problem, is there anything specific you are trying to do with Neo4j? Would it be helpful to see Neo4j being used as a replacement to a rational database?

    • @zappandy
      @zappandy 2 роки тому

      @@discoverpython9614 As a matter of fact, yes. That is an area that I think a lot of folks are interested in, myself included.
      What I was working on was entirely different, though. I was analyzing the relationships between COVID symptoms by comparing the similarity of key words. Regardless, I am well aware of some healthcare companies interested in replacing their relational databases with graph databases, so a video on that would be super interesting.

  • @bohu1122
    @bohu1122 Рік тому

    This is very useful as a beginners' guide for using Neo4j with Python. Thank you very much!

  • @varshakannan6822
    @varshakannan6822 2 роки тому

    wonderful video! just one doubt, each time i run all the cells on python notebook and check for the nodes in neo4j, it just keeps multiplying. Any fix for this issue?

  • @jameammarijr.2248
    @jameammarijr.2248 2 роки тому

    Many thanks.... God bless you :)

  • @rembautimes8808
    @rembautimes8808 3 роки тому

    Great video. As an aside wonder if there are any CEOs out there who flip a coin or run python random number to decide what transaction they are going to perform for the day

  • @carlomartinotti3649
    @carlomartinotti3649 2 роки тому

    7:18 you say that is possible to concatenate multiple commands together and execute them more rapidly, could you elaborate? I'm interested in how to speed up the process of writing onto a neo4j database, as I have to write hundredth of thousands of edges every time, and iterating one by one is way too slow.

    • @discoverpython9614
      @discoverpython9614  2 роки тому +1

      Sure, there are neo4j clauses you can use to programmatically create edges within neo4j.
      For example, instead of creating the edges via individual requests, you can use something like the foreach clause which can create the edges based on certain conditions after you have loaded in your data.
      Have a look at this link below from the documentation:
      neo4j.com/docs/cypher-manual/current/clauses/foreach/

  • @kaveriparida7575
    @kaveriparida7575 3 роки тому

    Hi, the video is good.
    I have a question, i want to connect neo4j desktop and python using an IP Address(as in graphDB=GraphDatabase.driver(uri="bolt://localhost:7687", auth=( "kaberi", "kaberi")) ,instead of localhost *i want to give IP Address) . Is it possible..?
    I have been looking into so many tutorials videos and documents but did'nt find any a way out.Kindly help

    • @discoverpython9614
      @discoverpython9614  2 роки тому

      Hi Kaveri, I'm sorry I missed this comment!!! The python doc's say that this needs to be a hostname rather than a IP address so what you can consider doing is adding a hostname alias on your machine then using that hostname in your driver function ..
      If you need help adding a hostname to your machine then let me know. Sorry again for such a late response!

  • @akadiryigit
    @akadiryigit 2 роки тому

    Absolutely remarkable :) Do you have any idea about connecting Looker and Neo4j ?

    • @discoverpython9614
      @discoverpython9614  2 роки тому

      Thats a bit tricky since the data out of Neo4j is pretty poor quality and hard to manipulate. If you want I can make a video to demonstrate this.

  • @damisg7
    @damisg7 3 роки тому

    Hi, what the fastest way to import a large dataset to neo4j with python. As a dataframe using pandas or as a json/csv with apoc library?

    • @discoverpython9614
      @discoverpython9614  3 роки тому

      It depends, how large is your dataset? If you are using a dataset less than 100K rows then I would say it doesn't matter too much which method you use. However, if your dataset is very large and you are running it on your local PC, then you will probably hit a heap/memory error so it might be better to use Python and break the upload into multiple iterations.

    • @damisg7
      @damisg7 3 роки тому

      @@discoverpython9614 It's larger yes, though my problem is that neo4j and python don't use a lot of resources while running, and that's why it takes so much time. If i had a way to increase the use of resources on my local pc i think it would be ok.

    • @discoverpython9614
      @discoverpython9614  3 роки тому

      @@damisg7 Have you tried uploading the data in parallel? Neo4j supports concurrent connections so this would be a way to increase the speed of your data import.

    • @discoverpython9614
      @discoverpython9614  3 роки тому

      @@damisg7 check out the multiprocessing package for python or if you know Go you can also use it to preform a concurrent import

  • @sowmyas5580
    @sowmyas5580 3 роки тому +3

    Hi, Could you make a video for import csv data into neo4j with python?

    • @discoverpython9614
      @discoverpython9614  3 роки тому

      No problem, here is the link to that video. ua-cam.com/video/0rs1Wdd7eCI/v-deo.html

    • @RahulYadav-ge5pn
      @RahulYadav-ge5pn 3 роки тому +2

      @@discoverpython9614 Hey Thanks for the link, but the video is not available .

  • @kunalk5806
    @kunalk5806 Рік тому

    so finally we have the financial data of 50000 nodes but why we don't have the relation between them? graph theory is about finding relation between nodes right?

    • @discoverpython9614
      @discoverpython9614  Рік тому

      This is a two part process. After you have imported your data as nodes, you need to define the relationships you want to see... does that make sense?

  • @peretternavn8287
    @peretternavn8287 2 роки тому

    I got like 101 for a tutorial video
    nice

  • @mladenkoml
    @mladenkoml 2 роки тому

    Although this video is about creating nodes in neo4j from python, the example that you give is completely wrong. Transactions are NOT nodes! Transactions are RELATIONSHIPS BETWEEN TWO OR MORE VENDOR NODES. So you should create nodes from vendors not transactions.