Package: network-cards
Network CardsA network card is a three-panel tabular summary of a network dataset:The first panel provides an overall summary of the network, the second summarizes the structure of the network (size, density, connectivity), and the third panel provides additional meta-information, what metadata are associated with nodes and links, how were the data gathered, and so forth.Network cards are intended to beconcise, readable and flexible, allowing researchers across fields to quickly read and understand studies involving network datasets.
We believe that a standard representation is crucial to ensuring that key information associated with network data remains available.This repository providestemplatesand aPython packageto create, update, and export network cards.Interested in more? Check outthe paper.Table of ContentsInstallRequirementsExampleCitationLicenseInstallpip install network-cardsRequirementsPython 3.8+NetworkxPandasExampleNetwork Cardsprovidesfill-in templatesbut you can also generate and save a card programmatically.
Here's Python code where we load a network from a file and compute the basic card:importnetworkxasnximportnetwork_cardsasncG=nx.read_edgelist("karate_club.edgelist")card=nc.NetworkCard(G)print(card)This gives:Name                       
                   Kind Undirected, unweighted
              Nodes are                       
              Links are                       
         Considerations                       
        Number of nodes                     34
        Number of links                     78
               Degree^1        4.58824 [1, 17]
             Clustering                  0.571
              Connected                    Yes
               Diameter                      5
 Assortativity (degree)                 -0.476
          Node metadata                       
          Link metadata                       
       Date of creation                       
Data generating process                       
                 Ethics                       
                Funding                       
               Citation                       

^1: Distributions summarized with average [min, max].Unfortunately, few of the important definitions, details or meta-information are computable, so
most of the fields outside the structure panel are blank.
Let's useupdate_*methods to populate the remaining fields ourselves:card.update_overall("Name","Zachary Karate Club")card.update_overall("Nodes are","Members of club at US university")card.update_overall("Links are","Members consistently interacted outside club")card.update_overall("Considerations","Heavily used as an example network")card.update_metainfo({"Node metadata":"None","Link metadata":"None (original study included eight interaction contexts)","Date of creation":"1977","Data generating process":"Direct observation of club members during period 1970-72","Funding":"None","Citation":"Zachary (1977)"})We usedcard.update_overall()andcard.update_metainfo()to insert entries into the previous card.
Entries can be updated one at a time (like we did when updating the overall panel) or a dictionary can be passed to update multiple entries at once.Now, print the revised card withprint(card):Name                                       Zachary Karate Club
                   Kind                                    Undirected, unweighted
              Nodes are                          Members of club at US university
              Links are              Members consistently interacted outside club
         Considerations                        Heavily used as an example network
        Number of nodes                                                        34
        Number of links                                                        78
               Degree^1                                           4.58824 [1, 17]
             Clustering                                                     0.571
              Connected                                                       Yes
               Diameter                                                         5
 Assortativity (degree)                                                    -0.476
          Node metadata                                                      None
          Link metadata None (original study included eight interaction contexts)
       Date of creation                                                      1977
Data generating process  Direct observation of club members during period 1970-72
                 Ethics                                                          
                Funding                                                      None
               Citation                                            Zachary (1977)

^1: Distributions summarized with average [min, max].And we can save to a convenient file format:card.to_latex("karate-card.tex")card.to_excel("karate-card.xlsx")CitationIf you use a Network Card, please citeour paper:Bagrow, J., & Ahn, Y. (2022). Network Cards: concise, readable summaries of network dataHere is a bibtex entry (.bib file):@unpublished{bagrow2022cards,author={Bagrow, James and Ahn, Yong-Yeol},title={Network Cards: concise, readable summaries of network data},year={2022},}and a .ris entry (.ris file):TY  - UNPB
AU  - Bagrow, James
AU  - Ahn, Yong-Yeol
TI  - Network Cards: concise, readable summaries of network data
PY  - 2022
DA  - 2022
ER  -LicenseBSD-3-Clause© James Bagrow