greenmining 1.0.8__tar.gz → 1.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {greenmining-1.0.8/greenmining.egg-info → greenmining-1.1.3}/PKG-INFO +1 -1
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/__init__.py +1 -1
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/services/github_graphql_fetcher.py +27 -22
- {greenmining-1.0.8 → greenmining-1.1.3/greenmining.egg-info}/PKG-INFO +1 -1
- {greenmining-1.0.8 → greenmining-1.1.3}/pyproject.toml +1 -1
- {greenmining-1.0.8 → greenmining-1.1.3}/CHANGELOG.md +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/LICENSE +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/MANIFEST.in +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/README.md +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/__main__.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/__version__.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/analyzers/__init__.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/analyzers/code_diff_analyzer.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/analyzers/metrics_power_correlator.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/analyzers/power_regression.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/analyzers/qualitative_analyzer.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/analyzers/statistical_analyzer.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/analyzers/temporal_analyzer.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/analyzers/version_power_analyzer.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/config.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/controllers/__init__.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/controllers/repository_controller.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/dashboard/__init__.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/dashboard/app.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/energy/__init__.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/energy/base.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/energy/carbon_reporter.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/energy/codecarbon_meter.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/energy/cpu_meter.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/energy/rapl.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/gsf_patterns.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/models/__init__.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/models/aggregated_stats.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/models/analysis_result.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/models/commit.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/models/repository.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/presenters/__init__.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/presenters/console_presenter.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/services/__init__.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/services/commit_extractor.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/services/data_aggregator.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/services/data_analyzer.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/services/github_fetcher.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/services/local_repo_analyzer.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/services/reports.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining/utils.py +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining.egg-info/SOURCES.txt +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining.egg-info/dependency_links.txt +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining.egg-info/requires.txt +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/greenmining.egg-info/top_level.txt +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/setup.cfg +0 -0
- {greenmining-1.0.8 → greenmining-1.1.3}/setup.py +0 -0
|
@@ -144,7 +144,7 @@ class GitHubGraphQLFetcher:
|
|
|
144
144
|
nodes = search.get("nodes", [])
|
|
145
145
|
for node in nodes:
|
|
146
146
|
if node and len(repositories) < max_repos:
|
|
147
|
-
repo = self._parse_repository(node)
|
|
147
|
+
repo = self._parse_repository(node, len(repositories) + 1)
|
|
148
148
|
repositories.append(repo)
|
|
149
149
|
|
|
150
150
|
# Check pagination
|
|
@@ -212,37 +212,42 @@ class GitHubGraphQLFetcher:
|
|
|
212
212
|
response.raise_for_status()
|
|
213
213
|
return response.json()
|
|
214
214
|
|
|
215
|
-
def _parse_repository(self, node: Dict[str, Any]) -> Repository:
|
|
215
|
+
def _parse_repository(self, node: Dict[str, Any], repo_id: int = 0) -> Repository:
|
|
216
216
|
# Parse GraphQL repository node to Repository object.
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
217
|
+
full_name = node.get("nameWithOwner", "")
|
|
218
|
+
owner = full_name.split("/")[0] if "/" in full_name else ""
|
|
219
|
+
url = node.get("url", "")
|
|
220
|
+
|
|
221
|
+
# Extract primary language
|
|
222
|
+
lang_node = node.get("primaryLanguage") or {}
|
|
223
|
+
language = lang_node.get("name")
|
|
223
224
|
|
|
224
225
|
# Extract license
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
license_info = node.get("licenseInfo") or {}
|
|
227
|
+
license_name = license_info.get("name")
|
|
228
|
+
|
|
229
|
+
# Extract default branch safely (can be null for empty repos)
|
|
230
|
+
branch_ref = node.get("defaultBranchRef") or {}
|
|
231
|
+
main_branch = branch_ref.get("name", "main")
|
|
228
232
|
|
|
229
233
|
return Repository(
|
|
234
|
+
repo_id=repo_id,
|
|
230
235
|
name=node.get("name", ""),
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
url=
|
|
236
|
+
owner=owner,
|
|
237
|
+
full_name=full_name,
|
|
238
|
+
url=url,
|
|
239
|
+
clone_url=f"{url}.git" if url else "",
|
|
240
|
+
language=language,
|
|
234
241
|
stars=node.get("stargazerCount", 0),
|
|
235
242
|
forks=node.get("forkCount", 0),
|
|
236
|
-
watchers=node.get("watchers"
|
|
237
|
-
|
|
238
|
-
|
|
243
|
+
watchers=(node.get("watchers") or {}).get("totalCount", 0),
|
|
244
|
+
open_issues=0,
|
|
245
|
+
last_updated=node.get("updatedAt", ""),
|
|
239
246
|
created_at=node.get("createdAt", ""),
|
|
240
|
-
|
|
241
|
-
|
|
247
|
+
description=node.get("description", ""),
|
|
248
|
+
main_branch=main_branch,
|
|
249
|
+
archived=node.get("isArchived", False),
|
|
242
250
|
license=license_name,
|
|
243
|
-
is_fork=node.get("isFork", False),
|
|
244
|
-
is_archived=node.get("isArchived", False),
|
|
245
|
-
default_branch=node.get("defaultBranchRef", {}).get("name", "main"),
|
|
246
251
|
)
|
|
247
252
|
|
|
248
253
|
def get_repository_commits(
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "greenmining"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.1.3"
|
|
8
8
|
description = "An empirical Python library for Mining Software Repositories (MSR) in Green IT research"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|