Package: biblyser
BiblyserBiblyseris an object-oriented Python workflow for computing and analysing bibliometrics for an individual or organisation.There are four key objects within Biblyser:Name, which holds information about an individual authorOrganisation, which represents a collection ofNameobjectsBib, which hold information about a publicationBibCollection, which represents a collection ofBibobjectsQuick startBiblyser can either be installed with pip or clones from the Github repository.pipinstallbiblysergitclonehttps://github.com/GEUS-Glaciology-and-Climate/BiblyserWhen cloning from the Github repository, you will need to create a conda environment with the required package dependencies by installing the Biblyser's dependencies using pip.pipinstallpybyliometrics,habanero,scholarly,gender_guesser,pandas,beautifulsoup4Try running one of the example scripts from the repository to see that it works. To access the Scopus API through the pybliometrics package, you will need to configure your API key.# Set up Scopus configuration (only needs to be done once)importpybliometricspybliometrics.scopus.utils.create_config()An API key or Insttoken is needed to use the Scopus API. An API key can be generated through the Elsevier Developer Portalhere, which can be used to access all authors and publications within your organisation when in your network or through VPN access. If accessing this from within the network is challenging, then an Insttoken can be requested by contacting Elsevier directly.After this initial set-up, no editing of the example scripts should be needed - the scripts should run as they are. If they don't, there is likely an issue with your python environment.Name.pyThe Name object holds attributes about an individual to aid in searching for associated publications. This can be initialised using an individual's full name, with job title and gender as optional inputs, and additional keyword inputs for Orcid ID, Scopus ID, Google Scholar ID, and h-index.frombiblyser.nameimportNamen=Name('Jane Emily Doe')#With fullname stringn=Name(['Jane','Emily','Doe'])#With first, middle and last name as listn=Name('Jane Emily Doe','Forsker','female',orcid='0000-0001-2345-6789')#With additional informationVarious name and initial formats are computed from Name object, which maximise the chance of finding all associated publications. The gender of each name can either be provided during initialisatoin, or guessed usinggender_guesser. The gender definition is used later on to analyse gender distribution in aBibCollection.Organisation.pyThe Organisation object holds a collection ofNameobjects which represent a group of authors, department, or organisation. The GEUS G&K organisation can be fetched either from the GEUS G&K Pure portal (only retrieves registered authors) or from the staff directory webpage (all G&K members). This information is fed directly into an Organisation object.frombiblyser.organisationimportOrganisation,fetchWebInfofrombs4importBeautifulSoupdeffetchWebInfo(url,parser,fid,classtype,classid):'''Get all up-to-date information (e.g. names, titles) from a given webpageelement id and class'''page=requests.get(url)soup=BeautifulSoup(page.content,parser)results=soup.find(id=fid)elements=results.find_all(classtype,class_=classid)returnelements#Get names and titles from GEUS Pure webpageURL="https://pub.geus.dk/da/organisations/department-of-glaciology-and-climate/persons/"info=fetchWebInfo(URL,'html.parser','main-content','div','rendering rendering_person rendering_short rendering_person_short')names=[]titles=[][names.append(str(e).split('span')[1].split('<')[0].split('>')[1])foreininfo][titles.append(str(e).split('span')[5].split('<')[0].split('- ')[1])foreininfo]#Get names and titles from GEUS staff webpageURL="https://www.geus.dk/om-geus/kontakt/telefonbog?departmentId=Glaciologi+og+Klima"names=fetchWebInfo(URL,'html.parser','gb_ContentPlaceHolderDefault_bottomGrid_ctl03','td','contact-name')titles=fetchWebInfo(URL,parser,fid,classtype,None)titles=info[:][4]#Define organisationorg=Organisation(names,titles)The Organisation object has a checker, which requires user input to manually edit Name objects - this is especially useful in cases of abnormal surname structures and mis-gendered Names. Once satisfied with the information held in the Organisation object, the Organisation object can be populated with missing information from Scopus and Scholar. The final populated object can either be written out of the object as a DataFrame, or carried forward and used to gather bib information as aBibCollection.#Organisation checkerorg.checkNames()#Populate author info from Scopus and Scholarorg.populateOrg()#Write Organisation attributes to DataFramedf=org.asDataFrame()Bib.pyA Bib object holds the relevant information associated with a single publication, namely:DOIPublication titleAuthors (held asNameobjects)Date of publicationJournal titlePublication typeGender metricsCitation countAltmetric recordA Bib object can either be initiated from a doi string, a title string, or from an author/organisation (as part of aBibCollection, see relevant section).frombiblyser.bibimportBib#Bib object from doi stringpub=Bib(doi='10.5194/tc-11-2691-2017')#Bib object from publication titlepub=Bib(title='PyTrx: A Python-Based Monoscopic Terrestrial Photogrammetry Toolset for Glaciology')Bib attributes are populated using the Scopus API provided bypybliometrics, CrossRef API provided byhabanero, and/or the Google Scholar APIscholarly.Authorship of a publication can be queried within the Bib object, including queries by organisation and (guessed) gender.BibCollection.pyA BibCollection object holds a collection ofBibobjects, i.e. a database of all associated or selected publications. A BibCollection can be initialised from anOrganisation(for which the BibCollection will search for all publications linked to each name in the organisation), a list ofBibobjects, or a list of doi strings.frombiblyser.organisationimportOrganisationfrombiblyser.bibCollectionimportBibCollection#BibCollection from an Organisationnames=['Penelope How','Kristin Schild']titles=['AC-medarbejder','Forsker']org=Organisation(names,titles)pubs=BibCollection(org)#Search for bibs in selected databasesbibs.getScholarBibs()#From Google Scholarbibs.getScopusBibs()#From Scopus (Pure)#BibCollection from list of Bib objectstitles=['PyTrx: A Python-Based Monoscopic Terrestrial Photogrammetry Toolset for Glaciology','Glacier calving rates due to subglacial discharge, fjord circulation, and free convection']bibs=[][bibs.append(Bib(title=t))fortintitles]pubs=BibCollection(bibs)#BibCollection from list of doi stringsdois=['10.3389/feart.2020.00021','10.1029/2017JF004520']pubs=BibCollection(dois)Constructing a BibCollection from anOrganisationcan create duplicates due to common authorships, and create false publications due to common names and tags. Duplicates, false matches and unwanted publications (e.g. conference abstracts, discussion papers) can be removed using the filtering functions provided in the BibCollection objects.#Remove abstracts and discussion papersbibs.removeAbstracts()bibs.removeDiscussions()#Remove duplicatesbibs.removeDuplicates()A BibCollection can also be written out of the object as a DataFrame if further inspection is needed#Check bibsbibs.checkBibs()#Remove duplicatesbibs.removeDuplicates()#Write BibCollection attributes to DataFramedf=bibs.asDataFrame()Computing gender metricsGenders of each author within the Bib object are firstly guessed, and if the guessed gender is not certian then a gender database is used to check if the author and an associated gender exists. This database is an Organisation object, retaining all information about each author's name and gender. If a name is not found in the database then the user is prompted to manually define the gender, and then retains this new addition.importcopy#Set up gender database using pre-existing organisationgdb=copy.copy(org)#Guess genders for all co-authors in BibCollectionbibs.getAllGenders(gdb)Further development we are working onIncorporation of other search APIs for publications, such asWeb Of ScienceFetch journal impact factorAdd "time from PhD" attribute to Name objectIncorporate abstracts to Bib objects and enable keyword searchesAnd contributions are welcome!