https://github.com/chengjun/scholarnetwork
Visualize coauthor network of Google Scholar
https://github.com/chengjun/scholarnetwork
Last synced: 9 months ago
JSON representation
Visualize coauthor network of Google Scholar
- Host: GitHub
- URL: https://github.com/chengjun/scholarnetwork
- Owner: chengjun
- Created: 2015-02-22T08:04:03.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2021-04-15T08:38:15.000Z (about 5 years ago)
- Last Synced: 2025-08-19T07:58:04.937Z (11 months ago)
- Language: Jupyter Notebook
- Homepage: https://pypi.python.org/pypi/scholarNetwork/
- Size: 6.46 MB
- Stars: 9
- Watchers: 4
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#scholarNetwork
Developed by Cheng-Jun Wang & Lingfei Wu
Cheng-Jun Wang wangchj04@gmail.com
Lingfei Wu wlf850927@gmail.com
## Introduction
scholarNetwork is a python package for crawling and visualizing the co-author network of Google Scholar.
To use it, you must have access to Google Scholar, and you would also install beautifulsoup4 and networkx during the installation process.
## Install
Install from pypi using pip or easy_install
pip install scholarNetwork
or
easy_install scholarNetwork
##Use
```python
# scholarNetwork
from scholarNetwork import scholarNetwork
import matplotlib.pyplot as plt
import networkx as nx
## The seed of crawler
seed = 'https://scholar.google.nl/citations?user=nNdt_G8AAAAJ&hl=en&oe=ASCII'
# How many nodes do you want to visulize? Always start with a small one.
Nmax = 21
## Get the graph g
g = scholarNetwork.getGraph(seed, Nmax)
## plot the network
pos=nx.spring_layout(g) #setup the layout
nx.draw(g, pos, node_shape = 'o',
edge_color = 'gray', width = 0.5,
with_labels = True, arrows = True)
plt.show()
```

Of course, you can get a much larger graph to see what's happening around you, just to change the value of Nmax. However, you have to be patient to wait for much longer time.

## Plot tree graph
```python
G=nx.DiGraph()
G.add_edge('source',1,weight=80)
G.add_edge(1,2,weight=50)
G.add_edge(1,3,weight=30)
G.add_edge(3,2,weight=10)
G.add_edge(2,4,weight=20)
G.add_edge(2,5,weight=30)
G.add_edge(4,5,weight=10)
G.add_edge(5,3,weight=5)
G.add_edge(2,'sink',weight=10)
G.add_edge(4,'sink',weight=10)
G.add_edge(3,'sink',weight=25)
G.add_edge(5,'sink',weight=35)
fig = plt.figure(figsize=(9, 9),facecolor='white')
ax = fig.add_subplot(111)
scholarNetwork.plotTree(G,ax)
plt.show()
```
For the coauthor network we have crawled, we can also visualize it as a tree.
```python
fig = plt.figure(figsize=(9, 9),facecolor='white')
ax = fig.add_subplot(111)
scholarNetwork.plotTree(g,ax)
plt.show()
```
