All Projects → aaronlelevier → neo4j-github-followers

aaronlelevier / neo4j-github-followers

Licence: other
Example project combining Neo4j, Python and Github API

Programming Languages

python
139335 projects - #7 most used programming language
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to neo4j-github-followers

neo4j-graphql-java
Pure JVM translation for GraphQL queries and mutations to Neo4j's Cypher
Stars: ✭ 94 (+394.74%)
Mutual labels:  neo4j
chatbot
kbqa task-oriented qa seq2seq ir neo4j jena seq2seq tf chatbot chat
Stars: ✭ 32 (+68.42%)
Mutual labels:  neo4j
impfuzzy
Fuzzy Hash calculated from import API of PE files
Stars: ✭ 67 (+252.63%)
Mutual labels:  neo4j
neo4j-serverless-functions
google cloud functions for ingesting data into neo4j
Stars: ✭ 17 (-10.53%)
Mutual labels:  neo4j
cotect
🛡Crowd-sourced COVID-19 reporting and assessment system.
Stars: ✭ 14 (-26.32%)
Mutual labels:  neo4j
Graph-OLAP
An attempt to model an OLAP cube with Neo4j.
Stars: ✭ 37 (+94.74%)
Mutual labels:  neo4j
social-graph-api
Authentication & Social Graph API built on top of Redis, Neo4J and Play!
Stars: ✭ 13 (-31.58%)
Mutual labels:  neo4j
opentelemetry-ext-js
js extensions for the open-telemetry project
Stars: ✭ 122 (+542.11%)
Mutual labels:  neo4j
liquigraph
Migrations for Neo4j
Stars: ✭ 122 (+542.11%)
Mutual labels:  neo4j
dstlr
scalable knowledge graph construction from unstructured text
Stars: ✭ 82 (+331.58%)
Mutual labels:  neo4j
neo4j-bloom
A public repository for informal docs, problem reporting and content sharing related to Neo4j Bloom.
Stars: ✭ 15 (-21.05%)
Mutual labels:  neo4j
flask-graphql-neo4j
A simple flask API to test-drive GraphQL and Neo4j
Stars: ✭ 74 (+289.47%)
Mutual labels:  neo4j
neo4j-graph-renderer
A React.js component that allows you to render neo4j graphs
Stars: ✭ 45 (+136.84%)
Mutual labels:  neo4j
neo4-js
Neo4-js is a object-graph mapper for JavaScript and neo4j with full flow-type support.
Stars: ✭ 19 (+0%)
Mutual labels:  neo4j
GraphDBLP
a Graph-based instance of DBLP
Stars: ✭ 33 (+73.68%)
Mutual labels:  neo4j
prov-db-connector
PROV Database Connector
Stars: ✭ 15 (-21.05%)
Mutual labels:  neo4j
NeoClient
🦉 Lightweight OGM for Neo4j which support transactions and BOLT protocol.
Stars: ✭ 21 (+10.53%)
Mutual labels:  neo4j
networkx-neo4j
NetworkX API for Neo4j Graph Algorithms.
Stars: ✭ 98 (+415.79%)
Mutual labels:  neo4j
GraphRepo
Github repo to Neo4j (and back)
Stars: ✭ 16 (-15.79%)
Mutual labels:  neo4j
py2neo
Py2neo is a comprehensive Neo4j driver library and toolkit for Python.
Stars: ✭ 1,105 (+5715.79%)
Mutual labels:  neo4j

README

Summary

This is an example project combining Neo4j, Python and Github API

This project demostrates:

  1. Call Github API using Python multithreading

  2. Collect data from threads and output to a followers.csv

  3. Use followers.csv which contains User data and Follower relationships to output CSVs distict for each:

    • users.csv - distinct Users
    • follows.csv - distinct mappings from User-to-Follows
  4. Load CSVs into Neo4j

  5. Create Neo4j relationships

  6. Query Neo4j using the Python neo4j-driver client

  7. Write queried data to write json

  8. Use json to generate a D3Js web graph

Quick Example

The current web/d3-results.json is already populated with my data, so just run:

cd web
npm install http-server
http-server

To build and run the project with your data

Create a Github API token - this will be needed to make requests if making over 60 requests an hour, the unauthenticated rate limit

pip install -r requirements.txt

Populate CSVs for the Github User whose followers is being populated

python code/followers.py --username <username>
python code/follows.py --username <username>
python code/users.py --username <username>

Data can be loaded into Neo4j using the below queries

After data is loaded, run this command to populate web/d3-results.json.

Environment varialbe NEO4J_PASSWORD will need to be set for the Neo4j database connection in query.py

python query.py

Start Node server and see data with D3Js

cd web
npm install http-server
http-server

Neo4j Queries

Load CSV

CSV must first be placed in the Neo4j /import/ dir:

/Users/aaron/Library/Application\ Support/Neo4j\ Desktop/Application/neo4jDatabases/database-0bf7614b-cb8d-405e-baef-e1b94485e662/installation-3.3.5/import/

Load Users table using CSV:

LOAD CSV WITH HEADERS FROM "file:///users.csv" AS row
CREATE (u:User)
SET u = row

Load Follows table using CSV:

LOAD CSV WITH HEADERS FROM "file:///follows.csv" AS row
CREATE (u:Follows)
SET u = row

Create Relationships

Create FOLLOWS relationships using previous 2 tables:

MATCH (u:User),(f:Follows), (u2:User)
WHERE u.login = f.login
  AND f.follows = u2.login
CREATE (u)-[:FOLLOWS]->(u2)

If you have to delete data and start over

First delete relationships:

MATCH ()-[r:FOLLOWS]-() 
DELETE r

Then delete tables:

MATCH (r:User)
DELETE r
MATCH (r:Follows)
DELETE r

Libraries Used

Database

Neo4j

Python

requests

neo4j-driver

Javascript

d3js

queue.js

LICENSE

BSD-2

CONTRIBUTING

Contact me if you found this interesting

FUTURE PLANS

Add more end-to-end Neo4j Graph Database examples

Example Graph output images from this repo

1st and 2nd level relationships (D3Js)

Imgur

1st level relationships (Neo4j)

Imgur

1st and 2nd level relationships (Neo4j)

Imgur

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].