Package: authorship
🚢 Authorship 🚢Format author lists for academic texts and journal submissions.🕵️ Why does this exist?Maintaining author lists on collaborative academic work is a bit of a pain.
A lot of us have started collecting author information on Google Sheets since
it allows people to input their own information, like their ORCID and
affiliations. I wanted to automate turning those sheets into some useful forms
for copy/pasting into my manuscripts (e.g., in Google Docs or LaTeX) as well
submission forms (e.g., bulk author TSV file import on bioRxiv).💪 Getting StartedThis example shows loading astandardized spreadsheetfrom Google Sheets that is subsequently printed in a nice text format, in a
bioRxiv bulk import format, and in LaTeX for a submission toNature Scientific Data.fromauthorship.readersimportGoogleSheetReaderfromauthorship.writersimportBiorxivWriter,ScientificDataWriter,TextWriter# Standard google sheetreader=GoogleSheetReader("1Fo1YH3ZzOVrQ4wzKnBm6sPha5hZG66-u-uSMDGUvguI")TextWriter().print(reader)BiorxivWriter().print(reader)ScientificDataWriter().print(reader)Theclass-resolverpackage can be
used as a shortcut to access the writers based on their names. It's smart and
figures out casing/spacing/ punctuation, so you don't have to worry about so
many imports. The following example does the same as the previous example:fromauthorship.readersimportGoogleSheetReaderreader=GoogleSheetReader("1Fo1YH3ZzOVrQ4wzKnBm6sPha5hZG66-u-uSMDGUvguI")reader.print("text")reader.print("biorxiv",file="~/Desktop/bioregistry_authors_biorxiv.tsv")reader.print("scientific data")reader.print("citation cff")The next example shows loading anOBO community-flavored spreadsheetfrom Google Sheets. This has been used for the SSSOM, ODK, Cell Ontology,
and several other papers.fromauthorship.readersimportOboGoogleSheetReader# OBO community-flavored google sheetreader=OboGoogleSheetReader("1NfhibWHOKgV2glmgRdKMzHEzTCw2_dUq_t0Zq64cgeQ",skiprows=1,)reader.print("text")reader.print("biorxiv",file="~/Desktop/sssom_authors_biorxiv.tsv")reader.print("scientific data")🐇 ExtendingYou can implement your own reader subclassing theauthorship.readers.Readerclass and implementing theget_authorship()function.Similarly, you can implement your own writer by subclassing theauthorship.writers.Writerclass and implementing theiter_lines()function.We'd be happy to accept new plugins, especially to help auto-generate LaTeX for
various journal-specific LaTeX templates.🚀 InstallationThe most recent release can be installed fromPyPIwith:$pipinstallauthorshipThe most recent code and data can be installed directly from GitHub with:$pipinstallgit+https://github.com/cthoyt/authorship.git👐 ContributingContributions, whether filing an issue, making a pull request, or forking, are appreciated. SeeCONTRIBUTING.mdfor more information on getting involved.👋 Attribution⚖️ LicenseThe code in this package is licensed under the MIT License.🍪 CookiecutterThis package was created with@audreyfeldroy'scookiecutterpackage using@cthoyt'scookiecutter-snekpacktemplate.🛠️ For DevelopersSee developer instructionsThe final section of the README is for if you want to get involved by making a code contribution.Development InstallationTo install in development mode, use the following:$gitclonegit+https://github.com/cthoyt/authorship.git
$cdauthorship
$pipinstall-e.🥼 TestingAfter cloning the repository and installingtoxwithpip install tox, the unit tests in thetests/folder can be
run reproducibly with:$toxAdditionally, these tests are automatically re-run with each commit in aGitHub Action.📖 Building the DocumentationThe documentation can be built locally using the following:$gitclonegit+https://github.com/cthoyt/authorship.git
$cdauthorship
$tox-edocs
$opendocs/build/html/index.htmlThe documentation automatically installs the package as well as thedocsextra specified in thesetup.cfg.sphinxplugins
liketexextcan be added there. Additionally, they need to be added to theextensionslist indocs/source/conf.py.📦 Making a ReleaseAfter installing the package in development mode and installingtoxwithpip install tox, the commands for making a new release are contained within thefinishenvironment
intox.ini. Run the following from the shell:$tox-efinishThis script does the following:UsesBump2Versionto switch the version number in thesetup.cfg,src/authorship/version.py, anddocs/source/conf.pyto not have the-devsuffixPackages the code in both a tar archive and a wheel usingbuildUploads to PyPI usingtwine. Be sure to have a.pypircfile configured to avoid the need for manual input at this
stepPush to GitHub. You'll need to make a release going with the commit where the version was bumped.Bump the version to the next patch. If you made big changes and want to bump the version by minor, you can
usetox -e bumpversion minorafter.