Skip to content

Commit 2a8711e

Browse files
committed
releases script
1 parent 8021d27 commit 2a8711e

File tree

3 files changed

+180
-0
lines changed

3 files changed

+180
-0
lines changed

config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ languages:
8585
parent: Help
8686
weight: 30
8787
url: /developer-guide/
88+
- name: Releases
89+
parent: Help
90+
weight: 35
91+
url: /releases/
8892
- name: Issue tracker
8993
parent: Help
9094
weight: 50

content/en/releases.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Harmony Releases
2+
3+
## v1.0.3 (23 January 2025)
4+
**Tag:** v1.0.3
5+
6+
What is new in this release:
7+
8+
The tool performs [clustering of question items](https://github.com/harmonydata/harmony/pull/70) both with k-means and by a deterministic algorithm (thanks Krithika!)
9+
10+
The Python library generates [crosswalks](https://github.com/harmonydata/harmony/pull/65)
11+
12+
There's a measure of instrument to instrument similarity
13+
14+
This is all updated in the [Walkthrough document](https://github.com/harmonydata/harmony/blob/main/Harmony_example_walkthrough.ipynb)
15+
16+
* We are allowing the user to turn on/off the [negation behaviour](https://github.com/harmonydata/harmony/issues/59)
17+
* The tool has [batching](https://github.com/harmonydata/harmony/issues/63) added to cope with larger lists of instruments (thanks makrianast )
18+
19+
20+
[View on GitHub](https://github.com/harmonydata/harmony/releases/tag/v1.0.3)
21+
22+
---
23+
24+
## v1.0.1 (26 November 2024)
25+
**Tag:** v1.0.1
26+
27+
Update dependencies and fix to non-breaking versions (HuggingFace, Numpy, Lxml) - some third party dependencies had been updated and were breaking the install.
28+
29+
Also, we have just had three fantastic pull requests in the Python repository:
30+
31+
* Batch code courtesy of @makrianast: [Allow batching of items when sent to LLM](https://github.com/harmonydata/harmony/pull/66) by Anastasia [original issue](https://github.com/harmonydata/harmony/issues/56)
32+
* Strip prefixes code courtesy of @abdullahwaqar [feat(utils): Add strip_prefixes function to remove common question prefix](https://github.com/harmonydata/harmony/pull/64) by Abdullah [original issue](https://github.com/harmonydata/harmony/issues/61)
33+
* Crosswalk table generation courtesy of @vkrithika25 [Added crosswalk table + unit tests](https://github.com/harmonydata/harmony/pull/65) by Krithika [original issue](https://github.com/harmonydata/harmony/issues/62)
34+
35+
[View on GitHub](https://github.com/harmonydata/harmony/releases/tag/v1.0.1)
36+
37+
---
38+
39+
## v1.0.0 (27 August 2024)
40+
**Tag:** v1.0.0
41+
42+
Add `match_instruments` functionality so that Harmony web API will now return matching items from catalogues such as UKLLC, Mental Health Catalogue
43+
Updated PDF extraction to use Scikit-Learn instead of spaCy
44+
Upgraded to Pydantic V2 (thanks to @op-cls)
45+
Add integration function `create_instrument_from_list` so that user can import to web UI from Python (documentation here: https://harmonydata.ac.uk/integrating-with-harmony/ ) :
46+
47+
```
48+
from harmony import create_instrument_from_list, import_instrument_into_harmony_web
49+
50+
instrument = load_instrument_from_list(["Do you currently smoke or have you ever smoked?", "[Do you currently use] nicotine replacement therapy?"])
51+
web_url = import_instrument_into_harmony_web(instrument)
52+
53+
print (web_url)
54+
```
55+
56+
[View on GitHub](https://github.com/harmonydata/harmony/releases/tag/v1.0.0)
57+
58+
---
59+
60+
## v0.5.2 (14 March 2024)
61+
**Tag:** v0.5.2
62+
63+
Return topic strengths (harmonydata/app#13)
64+
Return Python package version from API harmonydata/harmonyapi#3 harmonydata/app#12
65+
66+
[View on GitHub](https://github.com/harmonydata/harmony/releases/tag/v0.5.2)
67+
68+
---
69+
70+
## v0.5.1 (16 January 2024)
71+
**Tag:** v0.5.1
72+
73+
Refactoring of code (PR from Eve Cheng)
74+
Adding unit tests
75+
Minor bugfixes
76+
77+
[View on GitHub](https://github.com/harmonydata/harmony/releases/tag/v0.5.1)
78+
79+
---
80+
81+
## v0.5.0 (12 July 2023)
82+
**Tag:** v0.5.0
83+
84+
Added caching
85+
86+
[View on GitHub](https://github.com/harmonydata/harmony/releases/tag/v0.5.0)
87+
88+
---
89+
90+
## v0.4.0 (11 July 2023)
91+
**Tag:** v0.4.0
92+
93+
94+
95+
[View on GitHub](https://github.com/harmonydata/harmony/releases/tag/v0.4.0)
96+
97+
---
98+
99+
## v0.3.0-alpha (11 July 2023)
100+
**Tag:** v0.3.0-alpha
101+
102+
103+
104+
[View on GitHub](https://github.com/harmonydata/harmony/releases/tag/v0.3.0-alpha)
105+
106+
---
107+
108+
## Test release to Pypi (2) (10 June 2023)
109+
**Tag:** v0.2.0-alpha
110+
111+
112+
113+
[View on GitHub](https://github.com/harmonydata/harmony/releases/tag/v0.2.0-alpha)
114+
115+
---
116+
117+
## Test release to Pypi (10 June 2023)
118+
**Tag:** v0.1.0-beta
119+
120+
121+
122+
[View on GitHub](https://github.com/harmonydata/harmony/releases/tag/v0.1.0-beta)
123+
124+
---
125+

fetch_github_releases.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import requests
2+
from datetime import datetime
3+
4+
# GitHub repository details
5+
GITHUB_REPO = "harmonydata/harmony"
6+
GITHUB_TOKEN = "GITHUB_TOKEN" # Replace with your GitHub token
7+
8+
# Fetch releases from GitHub API
9+
def fetch_releases():
10+
url = f"https://api.github.com/repos/{GITHUB_REPO}/releases"
11+
headers = {"Authorization": f"token {GITHUB_TOKEN}"}
12+
13+
response = requests.get(url, headers=headers)
14+
response.raise_for_status()
15+
16+
return response.json()
17+
18+
# Generate Markdown content
19+
def generate_markdown(releases):
20+
markdown = f"# Harmony Releases\n\n"
21+
22+
for release in releases:
23+
published_date = datetime.strptime(release['published_at'], "%Y-%m-%dT%H:%M:%SZ").strftime("%d %B %Y")
24+
markdown += f"## {release['name']} ({published_date})\n"
25+
markdown += f"**Tag:** {release['tag_name']}\n\n"
26+
markdown += f"{release['body']}\n\n"
27+
markdown += f"[View on GitHub]({release['html_url']})\n\n"
28+
markdown += "---\n\n"
29+
30+
return markdown
31+
32+
# Save the Markdown to a file
33+
def save_markdown_file(content, filename="content/en/releases.md"):
34+
with open(filename, "w", encoding="utf-8") as file:
35+
file.write(content)
36+
37+
if __name__ == "__main__":
38+
try:
39+
print("Fetching releases...")
40+
releases = fetch_releases()
41+
print(f"Fetched {len(releases)} releases.")
42+
43+
print("Generating Markdown...")
44+
markdown_content = generate_markdown(releases)
45+
46+
print("Saving Markdown to file...")
47+
save_markdown_file(markdown_content)
48+
49+
print("Releases page created successfully: releases.md")
50+
except Exception as e:
51+
print(f"Error: {e}")

0 commit comments

Comments
 (0)