Move reference fetching code into a sub-library
This commit is contained in:
parent
97fef88498
commit
c880fe27a8
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -1,3 +1,3 @@
|
||||
[submodule "opendetex"]
|
||||
path = opendetex
|
||||
path = reference_fetcher/opendetex
|
||||
url = https://github.com/Phyks/opendetex
|
||||
|
10
README.md
10
README.md
@ -8,19 +8,19 @@ For building `opendetex` (which is a necessary dependency), you will need
|
||||
|
||||
* Clone this repository: `git clone https://github.com/Phyks/arxiv_metadata`.
|
||||
* Init submodules (`opendetex`): `git submodule init; git submodule update`.
|
||||
* Build `opendetex`: `cd opendetex; make`.
|
||||
* Build `opendetex`: `cd reference_fetcher/opendetex; make`.
|
||||
* You are ready to go.
|
||||
|
||||
## Usage
|
||||
|
||||
* `./main.py some_file.bbl` to get a list of DOIs associated to each `\bibitem`.
|
||||
* `./main.py arxiv_eprint_id` to get a list of DOIs associated to each reference from the provided arXiv eprint.
|
||||
* `./fetch_references.py some_file.bbl` to get a list of DOIs associated to each `\bibitem`.
|
||||
* `./fetch_references.py arxiv_eprint_id` to get a list of DOIs associated to each reference from the provided arXiv eprint.
|
||||
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
$ ./main.py 1401.2910
|
||||
$ ./fetch_references.py 1401.2910
|
||||
```
|
||||
|
||||
```
|
||||
@ -67,7 +67,7 @@ $ ./main.py 1401.2910
|
||||
|
||||
|
||||
```
|
||||
$ ./main.py /tmp/test.bbl
|
||||
$ ./fetch_reference.py /tmp/test.bbl
|
||||
```
|
||||
|
||||
```
|
||||
|
@ -3,8 +3,8 @@ import os
|
||||
import sys
|
||||
|
||||
# Local import
|
||||
import arxiv
|
||||
import bbl
|
||||
from ..reference_fetcher import arxiv
|
||||
from ..reference_fetcher import bbl
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
0
reference_fetcher/__init__.py
Normal file
0
reference_fetcher/__init__.py
Normal file
@ -1,11 +1,12 @@
|
||||
"""
|
||||
This file contains all the arXiv-specific functions.
|
||||
"""
|
||||
import bbl
|
||||
import io
|
||||
import requests
|
||||
import tarfile
|
||||
|
||||
from . import bbl
|
||||
|
||||
|
||||
def sources_from_arxiv(eprint):
|
||||
"""
|
@ -1,14 +1,14 @@
|
||||
"""
|
||||
This files contains all the functions to deal with bbl files.
|
||||
"""
|
||||
import doi
|
||||
import math
|
||||
import os
|
||||
import requests
|
||||
import subprocess
|
||||
|
||||
import regex
|
||||
import tools
|
||||
from . import doi
|
||||
from . import regex
|
||||
from . import tools
|
||||
|
||||
|
||||
def clean_bibitem(bibitem):
|
@ -3,8 +3,8 @@ This file contains all the DOI-related functions.
|
||||
"""
|
||||
import requests
|
||||
|
||||
import regex
|
||||
import tools
|
||||
from . import regex
|
||||
from . import tools
|
||||
|
||||
|
||||
def extract_doi_links(urls):
|
Loading…
Reference in New Issue
Block a user