https://github.com/zingale/ads2html
Parse ADS URLs for bibtex and create a convenient object for writing HTML publication lists
https://github.com/zingale/ads2html
Last synced: over 1 year ago
JSON representation
Parse ADS URLs for bibtex and create a convenient object for writing HTML publication lists
- Host: GitHub
- URL: https://github.com/zingale/ads2html
- Owner: zingale
- License: bsd-3-clause
- Created: 2016-02-07T15:23:22.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-03-08T17:53:34.000Z (over 8 years ago)
- Last Synced: 2025-01-24T13:11:14.341Z (over 1 year ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ads2html
This is a simple parser that will take a file of bibtex or a list of
ADS URLs and return a list of `Paper` objects that have the
bibliographic information in a convinent form for outputting to HTML.
Note: this requires python 3
## Working with a file containing bibtex
You can provide a file containing the bibtex for each paper directly from
ADS. You will need to add an additional field, `subject`, that will be
used for subject classication sorting. This can be assigned anything you
please.
```
import parser
papers = parser.parse_bibfile("papers.bib")
for p in papers:
t, o, l = p.jstring()
print(t, o, l)
```
## Working with a file containing ADS links
Your text file should be of the form:
```
subject: ads-url-to-abstract
```
E.g.,
```
algorithm: http://adsabs.harvard.edu/abs/2015ApJS..216...31Z
```
The paper ID will be obtained from the link and then the bibtex
will be directly downloaded from ADS. The rest of the procedure
works the same:
```
import parser
papers = parser.parse_urlfile("castro-papers.txt")
...
```
## Example
The example `write_papers_html.py` will demonstrate how to generate an
HTML table, sorted by subject, from a list of ADS URLs. This example
is from the Castro website: https://boxlib-codes.github.io/Castro/papers.html