-
Notifications
You must be signed in to change notification settings - Fork 4
/
test.py
67 lines (43 loc) · 1.42 KB
/
test.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
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 3 10:37:17 2023
@author: aas358
"""
from dblp_parser import DBLP
def parse_year_2022():
dblp = DBLP()
dblp_path = "dblp.xml"
save_path = "dblp_2022.jsonl"
dblp.parse_by_year("2022", dblp_path, save_path)
def parse_everything():
dblp = DBLP()
dblp_path = "dblp.xml"
save_path = "dblp.jsonl"
dblp.parse_all(dblp_path, save_path)
def parse_a_selectio_of_features():
dblp = DBLP()
dblp_path = "dblp.xml"
save_path = "dblp.jsonl"
features = {"url", "author", "ee", "journal", "number", "pages", "publisher", "series","booktitle", "title", "volume", "year"}
dblp.parse_all(dblp_path, save_path, features_to_extract=features)
def generate_dataframe():
dblp = DBLP()
dblp_path = "dblp.xml"
features = {"url", "author", "ee", "journal", "number", "pages", "publisher", "series","booktitle", "title", "volume", "year"}
df = dblp.parse_all(dblp_path, features_to_extract=features, output="dataframe")
print(df)
def download_the_latest_version_of_DBLP():
dblp = DBLP()
dblp.download_latest_dump()
def main():
"""
Main function
"""
download_the_latest_version_of_DBLP()
# parse_everything()
# parse_a_selectio_of_features()
# generate_dataframe()
parse_year_2022()
if __name__ == '__main__':
main()