Closed oscarvalenzuelab closed 6 months ago
def get_module_info(package_name, version): base_url = "https://proxy.golang.org" package_path = package_name.replace("/", "/") info_url = f"{base_url}/{package_path}/@v/{version}.info" response = requests.get(info_url) if response.status_code == 200: info = response.json() return info else: raise Exception(f"Failed to fetch module info for {package_name}@{version}: {response.status_code}") def get_module_license(package_name, version): info = get_module_info(package_name, version) return info.get("license", "License information not available")
Proposed code didn't worked as license it's not always present. moving to use detected license and SPDX for package license.