-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
29 lines (21 loc) · 809 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import arxiv
from utils import Paper, config, content_to_md, log, parse_papers, concat_filters
max_results = config["max_results"]
# get papers from arxiv via arxiv api
client = arxiv.Client()
content: dict[str, list[Paper]] = {}
for k in config["topics"]:
topic: str = k["name"]
log(f"Query topic {topic}")
content[topic] = parse_papers(client.results(arxiv.Search(
query=concat_filters(k["filters"]),
max_results=max_results,
sort_by=arxiv.SortCriterion.SubmittedDate
)))
content[topic].sort(reverse=True)
assert len(content[topic]) > 0, f"Content of {topic} empty"
log(f"Get code link of {topic}")
for paper in content[topic]:
paper.get_code_link()
# write papers of each topic to markdown
content_to_md(content, config["file_path"])