Last active
December 22, 2016 08:10
-
-
Save copystar/082ee2161f9c7a54c47a to your computer and use it in GitHub Desktop.
How to use bibliograph.parsing?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm hoping to do some citation analysis. | |
I want to count from a set of Web of Science records: | |
How many come from a particular institution? How many from that set are from a particular publisher? | |
I know this is possible if I learn BibTex. | |
But that's sounds like a lot of work for really just counting items in a set. | |
I found a Python module called bibliograph.parsing that sounds promising. | |
It takes citations of various formats and returns them in a Python dictionary. | |
And I know that there are a lot of Python commands for counting items within dictionaries. | |
The module is here: https://github.com/collective/bibliograph.parsing | |
The trouble is that there is no documentation or even an example so I can figure out how to use this module. | |
This suggests that it's using some sort of protocol (piping, I guess) | |
that is obvious to experienced programmers and invisible to others. | |
So given that I have a file called citations.txt, citations.bib, or citations.enl, | |
what would I type in to return a dictionary of citations using bibliograph.parsing? |
Oops! I missed copypasting this line:
>>> parser = BibtexParser()
I've added it to my comment above.
apt-get install bibutils
should be totally fine.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks SOOOO much! Unfortunately, for some reason, the line "source = parser.preprocess(bib)" results in an error message:
(Because I'm using Ubuntu on a non-mac, instead of "brew install bibutils" - I used apt-get install bibutils. Not sure if this is a difference that makes a difference)