Skip to content

Commit ae85d05

Browse files
authored
add contributors to the github section (#981)
1 parent d976e2c commit ae85d05

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+136
-9
lines changed

ecosystem/github.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77

88
from .serializable import JsonSerializable, parse_datetime
99
from .error_handling import EcosystemError, logger
10-
from .request import request_json, parse_github_package_ids, parse_github_dependants
10+
from .request import (
11+
request_json,
12+
parse_github_package_ids,
13+
parse_github_dependants,
14+
parse_github_front_page,
15+
)
1116

1217

1318
class GitHubData(JsonSerializable):
@@ -24,6 +29,7 @@ class GitHubData(JsonSerializable):
2429
"homepage",
2530
"license",
2631
"description",
32+
"estimated_contributors",
2733
"total_dependent_repositories",
2834
"total_dependent_packages",
2935
"private",
@@ -54,6 +60,7 @@ def __init__(self, owner: str, repo: str, tree: str = None, **kwargs):
5460
self._json_repo = None
5561
self._json_package_ids = None
5662
self._json_dependants = None
63+
self._json_front_page = None
5764

5865
def to_dict(self) -> dict:
5966
dictionary = {}
@@ -98,8 +105,13 @@ def update_json(self):
98105
Fetches remote data from:
99106
- api.github.com/repos/{self.owner}/{self.repo}
100107
- github.com/{self.owner}/{self.repo}/network/dependents
108+
- github.com/{self.owner}/{self.repo}
101109
"""
102110
self._json_repo = request_json(f"api.github.com/repos/{self.owner}/{self.repo}")
111+
self._json_front_page = request_json(
112+
f"github.com/{self.owner}/{self.repo}/",
113+
parser=parse_github_front_page,
114+
)
103115
self._json_package_ids = request_json(
104116
f"github.com/{self.owner}/{self.repo}/network/dependents?dependent_type=REPOSITORY",
105117
parser=parse_github_package_ids,
@@ -157,6 +169,19 @@ def dependants(self, refresh=False):
157169
self.update_json()
158170
return self._json_dependants
159171

172+
def front_page_data(self, refresh=False):
173+
"""get the front page data from (cached) JSON"""
174+
if refresh:
175+
self.update_json()
176+
return self._json_front_page
177+
178+
@property
179+
def estimated_contributors(self):
180+
"""..."""
181+
if self.front_page_data():
182+
return self.front_page_data()["estimated_contributors"]
183+
return None
184+
160185
@property
161186
def total_dependent_repositories(self):
162187
"""Sum of repository dependants"""

ecosystem/request.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,25 @@ def parse_url(original_url: str):
6060
)
6161

6262

63+
def parse_github_front_page(html_text):
64+
"""
65+
Gets data from the front page github.com/<owner>/<repo>
66+
{
67+
estimated_contributors = int
68+
}
69+
"""
70+
soup = BeautifulSoup(html_text, "html.parser")
71+
found = soup.find("a", {"href": re.compile(r"graphs/contributors")})
72+
if found is None:
73+
return None
74+
contributor_text = found.get_text()
75+
for line in contributor_text.split("\n"):
76+
candidate = line.strip()
77+
if candidate.isdigit():
78+
return {"estimated_contributors": int(candidate)}
79+
return {}
80+
81+
6382
def parse_github_package_ids(html_text):
6483
"""
6584
Find the package ids for github.com/<owner>/repo/network/

ecosystem/resources/members/QCRAFT-AutoSchedulQ.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ repo = "QCRAFT-AutoScheduler"
1919
stars = 18
2020
license = "Other"
2121
description = "QCRAFT AutoScheduler: a library that allows users to automatically schedule the execution of their own quantum circuits, improving efficiency and reducing execution times in quantum computing environments."
22+
estimated_contributors = 2
2223
total_dependent_repositories = 3
2324
total_dependent_packages = 0
2425
last_commit = 2025-10-28T08:42:08Z

ecosystem/resources/members/QPong.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ repo = "QPong"
1717
stars = 122
1818
license = "Apache License 2.0"
1919
description = "A quantum version of the classic Pong"
20+
estimated_contributors = 9
2021
total_dependent_repositories = 0
2122
total_dependent_packages = 0
2223
last_commit = 2024-06-15T20:19:28Z

ecosystem/resources/members/Qamomile.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ owner = "Jij-Inc"
1616
repo = "Qamomile"
1717
stars = 12
1818
license = "Apache License 2.0"
19+
estimated_contributors = 13
1920
total_dependent_repositories = 2
2021
total_dependent_packages = 1
2122
last_commit = 2025-11-11T11:18:32Z

ecosystem/resources/members/Qelm.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ stars = 24
1919
homepage = "https://www.Qelm.org"
2020
license = "Other"
2121
description = "Qelm - Quantum Enhanced Language Model"
22+
estimated_contributors = 3
2223
total_dependent_repositories = 0
2324
total_dependent_packages = 0
2425
last_commit = 2025-11-11T02:51:11Z

ecosystem/resources/members/QiskitOpt.jl.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ repo = "QiskitOpt.jl"
1919
stars = 13
2020
license = "MIT License"
2121
description = "JuMP wrapper for IBMQ Optimization Algorithms (ft QUBODrivers.jl)"
22+
estimated_contributors = 3
2223
total_dependent_repositories = 0
2324
total_dependent_packages = 0
2425
last_commit = 2024-06-19T13:04:10Z

ecosystem/resources/members/QuPepFold.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ repo = "QuPepFold"
1717
stars = 1
1818
license = "MIT License"
1919
description = "QupepFold is a small, research-oriented toolkit that turns short amino-acid sequences into quantum bitstring encodings, optimizes them with a CVaR-VQE routine, and exports 3D PDB files"
20+
estimated_contributors = 2
2021
total_dependent_repositories = 0
2122
total_dependent_packages = 0
2223
last_commit = 2025-10-21T09:51:12Z

ecosystem/resources/members/RasQberry.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ repo = "RasQberry"
1717
stars = 152
1818
license = "Apache License 2.0"
1919
description = "The RasQberry project: Exploring Quantum Computing and Qiskit with a Raspberry Pi and a 3D Printer"
20+
estimated_contributors = 10
2021
total_dependent_repositories = 0
2122
total_dependent_packages = 0
2223
last_commit = 2025-10-28T10:02:29Z

ecosystem/resources/members/antinature.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ stars = 3
1919
homepage = "https://antinature.dirac.fun"
2020
license = "MIT License"
2121
description = "py module for studying antimatter using quantum computing approach"
22+
estimated_contributors = 2
2223
total_dependent_repositories = 1
2324
total_dependent_packages = 0
2425
last_commit = 2025-08-11T18:52:41Z

0 commit comments

Comments
 (0)