I have a csv and I want to read it directly into a Neo4J database. I'm envisioning something along the lines of:
LOAD CSV WITH HEADERS FROM 'file:///somewhere_accessable_to_anyone/some_csv.csv' line AS I tried the public folder in my Dropbox but that just gives a link to the csv.
I've tried some file hosting sites and again, they just want to host the file with a link that is accessible to click on for download, and displayed on an ad-packed page.
Has anyone found a good way to do this?
06 Answers
As for a Google Drive approach, you don't even need to first open the CSV file in Sheets. Simply click the CSV to view it
Take note of the FILE_ID (highlighted in blue above) and add it the URL below as follows
This url is a direct link to the file download which tools like Neo4j or pandas.read_csv() can use.
You can use Google spreadsheets:
From that blog written by Rik, here are the main take away's:
- the spreadsheet needs to be publicly accessible over the internet.
- you need to generate the download URI of the CSV export
- Import process in Neo4j is very simple now, with Load CSV
load csv with headers from "your url to spreadsheet" as csv fieldterminator ',' merge (col:COLOUR { name: csv.Colour}) with col,csv match (n:COLOUR {name: col.name}) create (p:PERSON {name: csv.Name})-[:HAS]->(col); 1You can force file download of public files on Dropbox by adding ?dl=1 to the public URL. See
AWS S3 is a popular option too, but it's not straight forward if you are not familiar with AWS already.
After searching for hours, I finally found the solution that worked.
The best option is through Google Spreadsheet
- Host the file on Google drive
- Navigate to the file and open in Google Sheets
- Click on File > Share > Share with others > Change to anyone with the link > Done
- In the address bar, you will notice a link like this
- Just copy the part after 'd' which is
1T0OygJBMcStdC7dTP0CKofEr3dCTsMcRJhoin our case. - Now, plug in the key we copied above in
- Hence, in our case, the link will be
We now have the link ready
Open Neo4j Aura Console and click Neo4j Browser and connect with your credentials 
Next run the following query to test
LOAD CSV FROM ' AS ROW RETURN ROW LIMIT 10
Credits: Using Google Sheets to Host Editable CSV Files
Direct URLs for Github Files
After the file has been uploaded to Github, click the filename in the list and you’ll get the file’s URL in the browser’s address. Append ?raw=true to the URL and you get a downloadable version.
You can use that url in your fetch api like fetch, axios, ajax etc.
2022 answer:
Google sheets now has a built in Publish to web option. Create your sheet with data then Go to File -> Share -> Publish to web
From the dialog: Choose the tab of the sheet you want to host and the format you are publishing to e.g. CSV. Then click the Publish button. The URL is shown on the dialog.