Commit
•
7641c8b
1
Parent(s):
99dbf0f
Fixing readme
Browse files- utilities/readme_update.py +11 -11
utilities/readme_update.py
CHANGED
@@ -13,20 +13,20 @@ def get_readme_path(dataset_name):
|
|
13 |
def update_readme(dataset_name, subreddit, date_to_fetch):
|
14 |
path = get_readme_path(dataset_name=dataset_name)
|
15 |
readme_text = f"""
|
16 |
-
|
17 |
-
|
18 |
|
19 |
-
|
20 |
-
|
21 |
|
22 |
-
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
|
27 |
|
28 |
-
|
29 |
-
|
30 |
"""
|
31 |
|
32 |
append_readme(path=path, readme_text=readme_text)
|
@@ -40,7 +40,7 @@ def append_readme(path, readme_text):
|
|
40 |
|
41 |
if generated_below_marker in content:
|
42 |
index = content.index(generated_below_marker) + len(generated_below_marker)
|
43 |
-
content = content[:index] + "\n
|
44 |
else:
|
45 |
content += "\n" + generated_below_marker + "\n" + readme_text + "\n"
|
46 |
|
|
|
13 |
def update_readme(dataset_name, subreddit, date_to_fetch):
|
14 |
path = get_readme_path(dataset_name=dataset_name)
|
15 |
readme_text = f"""
|
16 |
+
# Dataset Name
|
17 |
+
{dataset_name}
|
18 |
|
19 |
+
## Update Frequency
|
20 |
+
The dataset is updated daily and covers the period from `{os.environ["START_DATE"]}` to {date_to_fetch}
|
21 |
|
22 |
+
## Dataset Overview
|
23 |
+
The goal is to have an open dataset of `{subreddit}` submissions. This has been taken from the Pushshift API.
|
24 |
|
25 |
+
## Data Collection
|
26 |
+
This has been collected with sequential calls that follow the pagination of the pushshift request.
|
27 |
|
28 |
+
## Attribution
|
29 |
+
Data sourced from the Pushshift API.
|
30 |
"""
|
31 |
|
32 |
append_readme(path=path, readme_text=readme_text)
|
|
|
40 |
|
41 |
if generated_below_marker in content:
|
42 |
index = content.index(generated_below_marker) + len(generated_below_marker)
|
43 |
+
content = content[:index] + "\n\n" + readme_text
|
44 |
else:
|
45 |
content += "\n" + generated_below_marker + "\n" + readme_text + "\n"
|
46 |
|