Arxiv Downloader
ArXiv paper downloader implementation.
ArxivDownloader
Bases: BasePaperDownloader
ArXiv-specific implementation of paper downloader.
Source code in aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
|
__init__(config)
Initialize ArXiv downloader with configuration.
Source code in aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py
20 21 22 23 24 25 26 27 28 |
|
_add_service_identifier(entry, identifier)
Add arXiv ID field to entry.
Source code in aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py
207 208 209 |
|
_extract_abstract(entry, ns)
Extract abstract from entry.
Source code in aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py
155 156 157 158 |
|
_extract_authors(entry, ns)
Extract authors from entry.
Source code in aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py
146 147 148 149 150 151 152 153 |
|
_extract_basic_metadata(entry, ns)
Extract basic metadata (title, authors, abstract, date) from entry.
Source code in aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py
127 128 129 130 131 132 133 134 135 136 137 138 139 |
|
_extract_pdf_metadata(pdf_result, identifier)
Extract PDF-related metadata.
Source code in aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
|
_extract_publication_date(entry, ns)
Extract publication date from entry.
Source code in aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py
160 161 162 163 164 165 |
|
_extract_title(entry, ns)
Extract title from entry.
Source code in aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py
141 142 143 144 |
|
_get_paper_identifier_info(paper)
Get arXiv-specific identifier info for paper summary.
Source code in aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py
201 202 203 204 205 |
|
construct_pdf_url(metadata, identifier)
Extract or construct PDF URL from arXiv metadata.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metadata
|
Element
|
XML root from arXiv API |
required |
identifier
|
str
|
arXiv ID |
required |
Returns:
Type | Description |
---|---|
str
|
PDF URL string |
Source code in aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
extract_paper_metadata(metadata, identifier, pdf_result)
Extract structured metadata from arXiv API response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metadata
|
Element
|
XML root from arXiv API |
required |
identifier
|
str
|
arXiv ID |
required |
pdf_result
|
Optional[Tuple[str, str]]
|
Tuple of (temp_file_path, filename) if PDF downloaded |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Standardized paper metadata dictionary |
Source code in aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
fetch_metadata(identifier)
Fetch paper metadata from arXiv API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier
|
str
|
arXiv ID (e.g., '1234.5678' or '2301.12345') |
required |
Returns:
Type | Description |
---|---|
Element
|
XML root element from arXiv API response |
Raises:
Type | Description |
---|---|
RequestException
|
If API call fails |
RuntimeError
|
If no entry found in response |
Source code in aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
get_default_filename(identifier)
Generate default filename for arXiv paper.
Source code in aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py
197 198 199 |
|
get_identifier_name()
Return identifier display name.
Source code in aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py
193 194 195 |
|
get_service_name()
Return service name.
Source code in aiagents4pharma/talk2scholars/tools/paper_download/utils/arxiv_downloader.py
189 190 191 |
|