Skip to main content

CoAuthorNet

CoAuthorNet is a Python package for analyzing and visualizing university authorship networks. It facilitates the retrieval of publication data for university staff, builds co-authorship networks, calculates network metrics, and visualizes the largest connected component of the network. CoAuthorNet is ideal for researchers interested in studying collaboration patterns within academic institutions.

Features

  • Fetch publication data for university staff from Google Scholar
  • Create bipartite author-publication and co-authorship networks
  • Calculate network metrics (average degree, clustering coefficient, shortest path length, etc.)
  • Visualize the largest connected component of the co-authorship network

Installation

To install CoAuthorNet, use pip:

pip install CoAuthorNet

Requirements

CoAuthorNet requires the following dependencies:

  • pandas
  • networkx
  • numpy
  • matplotlib
  • tqdm
  • scholarly

These are automatically installed with the package.

Usage

Here’s a quick example to get started with CoAuthorNet.

  1. Prepare a CSV file with a column named Staff Name, containing the names of staff members. Example CSV (author_school.csv):

    Staff Name,School,Faculty
    Alice Smith,School of Chemistry,Faculty of Science
    Bob Jones,School of Physics,Faculty of Science
    
  2. Run the code below to create and analyze the co-authorship network:

     import CoAuthorNet as yn
     import pandas as pd
    
     staff_data = pd.read_csv("./author_school.csv")
     staff_publications_data = yn.fetch_publications(staff_data, affiliation = 'insert_affiliation')
    
    
     G, author_dict, paper_dict = yn.create_bipartite_network(staff_publications_data)
     author_network = yn.create_authorship_network(G, author_dict)
    
    
     author_network_gc = yn.get_largest_component(author_network)
     yn.save_graph(author_network_gc, "largest_component.graphml")
     metrics = yn.calculate_metrics(author_network_gc)
     print(metrics)
    

Function Reference

  • fetch_publications(staff_data, output_csv='staff_publications_data.csv', affiliation)

    • Fetches publication data for each staff member and saves it to a CSV file. Affiliation corresponds to the university or orgnization the individual is connected to. This will allow for more accurate results incase of duplicate names. If unknown, that leave blank.
  • create_bipartite_network(df)

    • Creates a bipartite network of authors and publications from the data.
  • create_authorship_network(G, author_dict)

    • Converts the bipartite network into a co-authorship network.
  • get_largest_component(graph)

    • Extracts the largest connected component of a graph.
  • calculate_metrics(G)

    • Calculates various network metrics like average degree, clustering coefficient, etc.
  • save_graph(G)

    • Saves largest component as a .graphml file.
  • plot_network(G, output_file='largest_component_network.png')

    • Plots and saves the largest connected component of the co-authorship network.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Feel free to submit a pull request or report issues.

Release files for CoAuthorNet 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for CoAuthorNet 0.2.0
File Size Uploaded
CoAuthorNet-0.2.0.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for CoAuthorNet 0.2.0
File Interpreter ABI Platform
CoAuthorNet-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.8 kB

Release files / CoAuthorNet-0.2.0.tar.gz

Download URL CoAuthorNet-0.2.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5a52120d0f3634e8ab3e31ddd99f723003ee08cd1dc7f12213bf0642be380da8
BLAKE2b-256 checksum
How to use checksums
1e04853d9362531bda3ee564d2a0e9821ba518d6846d24a4ab87d4f211765b93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.1

Release files / CoAuthorNet-0.2.0-py3-none-any.whl

Download URL CoAuthorNet-0.2.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5f8aed80da09653d13e37c77db1294abfd6e4ea440bde14ab6d1d3f2c463e07
BLAKE2b-256 checksum
How to use checksums
1bebc3c190a298708879a3e5e9d6d93f0e0b6e75f7668a3a26570d72f23d85ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.1

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page