Skip to content

Commit

Permalink
Harmonize calls
Browse files Browse the repository at this point in the history
  • Loading branch information
dagonzalezfo committed Jan 30, 2024
1 parent 4d674a2 commit b66e4c3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions licenses/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@ def pypi(project):
Function that retrives licence from PiPy
"""
url = "https://pypi.org/pypi/"
r = requests.get(url + project + "/json").json()
r = requests.get(url + project + "/json")
if r.status_code != 200:
return "not found"
else:
return(r['info']['license'])
return(r.json()['info']['license'])

def cran(project):
"""
Function that retrieves licence from CRAN
"""
url = "http://crandb.r-pkg.org/"
r = requests.get(url + project).json()
r = requests.get(url + project)
if r.status_code != 200:
return "not found"
else:
return(r['License'])
return(r.json()['License'])

def repology(project):
url="https://repology.org//api/v1/"
Expand Down

0 comments on commit b66e4c3

Please sign in to comment.