Skip to content

Commit

Permalink
Merge pull request #50 from TheAntiSnipe/dev
Browse files Browse the repository at this point in the history
Built the getVersion() function
  • Loading branch information
Yo Yehudi authored Oct 15, 2019
2 parents 091e556 + 8e432bd commit abccfa8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions intermine/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,31 @@
"""


def getVersion(mine):
"""
A function to return the API version, release version and
InterMine version numbers
================================================
example:
>>> from intermine import registry
>>> registry.getVersion('flymine')
>>> {'API Version:': '30', 'Release Version:': '48 2019 October',
'InterMine Version:': '4.1.0'}
"""
link = "http://registry.intermine.org/service/instances/" + mine
try:
r = requests.get(link)
dict = json.loads(r.text)
return {
"API Version:": dict["instance"]["api_version"],
"Release Version:": dict["instance"]["release_version"],
"InterMine Version:": dict["instance"]["intermine_version"]
}
except KeyError:
return "No such mine available"

def getInfo(mine):
"""
A function to get information about a mine
Expand Down

0 comments on commit abccfa8

Please sign in to comment.