bioversions 0.5.320__py3-none-any.whl → 0.7.1__py3-none-any.whl
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.
- bioversions/__init__.py +7 -3
- bioversions/__main__.py +0 -2
- bioversions/charts.py +3 -7
- bioversions/cli.py +3 -5
- bioversions/py.typed +0 -0
- bioversions/resources/__init__.py +18 -7
- bioversions/resources/update.py +20 -12
- bioversions/resources/versions.json +20536 -0
- bioversions/slack_client.py +2 -5
- bioversions/sources/__init__.py +45 -17
- bioversions/sources/antibodyregistry.py +9 -6
- bioversions/sources/bigg.py +5 -7
- bioversions/sources/biogrid.py +0 -2
- bioversions/sources/cellosaurus.py +3 -5
- bioversions/sources/chebi.py +1 -3
- bioversions/sources/chembl.py +3 -3
- bioversions/sources/chemidplus.py +1 -3
- bioversions/sources/civic.py +46 -0
- bioversions/sources/complexportal.py +0 -2
- bioversions/sources/daily.py +0 -2
- bioversions/sources/depmap.py +1 -3
- bioversions/sources/dgi.py +9 -12
- bioversions/sources/disgenet.py +1 -3
- bioversions/sources/drugbank.py +2 -4
- bioversions/sources/drugcentral.py +2 -4
- bioversions/sources/ensembl.py +4 -6
- bioversions/sources/expasy.py +1 -4
- bioversions/sources/flybase.py +0 -2
- bioversions/sources/gtdb.py +35 -0
- bioversions/sources/guidetopharmacology.py +3 -4
- bioversions/sources/hgnc.py +13 -14
- bioversions/sources/homologene.py +0 -2
- bioversions/sources/icd10.py +30 -0
- bioversions/sources/icd11.py +30 -0
- bioversions/sources/icf.py +30 -0
- bioversions/sources/intact.py +0 -2
- bioversions/sources/interpro.py +1 -3
- bioversions/sources/itis.py +8 -15
- bioversions/sources/kegg.py +7 -6
- bioversions/sources/mesh.py +10 -5
- bioversions/sources/mgi.py +0 -2
- bioversions/sources/mirbase.py +13 -7
- bioversions/sources/moalmanac.py +0 -2
- bioversions/sources/msigdb.py +0 -2
- bioversions/sources/ncit.py +1 -4
- bioversions/sources/npass.py +0 -2
- bioversions/sources/obo.py +4 -6
- bioversions/sources/ols.py +6 -8
- bioversions/sources/omim.py +33 -0
- bioversions/sources/oncotree.py +4 -4
- bioversions/sources/pathbank.py +0 -2
- bioversions/sources/pathwaycommons.py +0 -2
- bioversions/sources/pfam.py +0 -2
- bioversions/sources/pombase.py +0 -2
- bioversions/sources/pr.py +1 -3
- bioversions/sources/pubchem.py +0 -2
- bioversions/sources/reactome.py +0 -2
- bioversions/sources/rfam.py +0 -2
- bioversions/sources/rgd.py +1 -3
- bioversions/sources/rhea.py +1 -6
- bioversions/sources/rxnorm.py +1 -3
- bioversions/sources/sgd.py +0 -2
- bioversions/sources/signor.py +36 -0
- bioversions/sources/slm.py +4 -3
- bioversions/sources/stringdb.py +2 -4
- bioversions/sources/umls.py +0 -2
- bioversions/sources/uniprot.py +1 -3
- bioversions/sources/unversioned.py +0 -2
- bioversions/sources/wikipathways.py +0 -2
- bioversions/sources/zfin.py +0 -2
- bioversions/templates/base.html +28 -0
- bioversions/templates/home.html +60 -0
- bioversions/twitter_client.py +5 -8
- bioversions/utils.py +40 -32
- bioversions/version.py +3 -5
- bioversions/wsgi.py +2 -4
- bioversions-0.7.1.dist-info/METADATA +393 -0
- bioversions-0.7.1.dist-info/RECORD +81 -0
- bioversions-0.7.1.dist-info/WHEEL +4 -0
- {bioversions-0.5.320.dist-info → bioversions-0.7.1.dist-info}/entry_points.txt +1 -0
- {bioversions-0.5.320.dist-info → bioversions-0.7.1.dist-info/licenses}/LICENSE +1 -1
- bioversions-0.5.320.dist-info/METADATA +0 -166
- bioversions-0.5.320.dist-info/RECORD +0 -72
- bioversions-0.5.320.dist-info/WHEEL +0 -5
- bioversions-0.5.320.dist-info/top_level.txt +0 -1
bioversions/sources/hgnc.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""A getter for HGNC."""
|
4
2
|
|
5
3
|
import logging
|
6
4
|
|
7
|
-
|
5
|
+
import requests
|
6
|
+
|
7
|
+
from bioversions.utils import Getter, VersionType
|
8
8
|
|
9
9
|
__all__ = [
|
10
10
|
"HGNCGetter",
|
@@ -12,8 +12,9 @@ __all__ = [
|
|
12
12
|
|
13
13
|
logger = logging.getLogger(__name__)
|
14
14
|
|
15
|
-
PATH = "https://
|
16
|
-
|
15
|
+
PATH = "https://storage.googleapis.com/public-download-files/hgnc/archive/archive/monthly/json/"
|
16
|
+
URL = "https://storage.googleapis.com/storage/v1/b/public-download-files/o?prefix=hgnc/archive/archive/monthly"
|
17
|
+
PREFIX = "hgnc/archive/archive/monthly/json/hgnc_complete_set_"
|
17
18
|
SUFFIX = ".json"
|
18
19
|
|
19
20
|
|
@@ -22,20 +23,18 @@ class HGNCGetter(Getter):
|
|
22
23
|
|
23
24
|
bioregistry_id = "hgnc"
|
24
25
|
name = "HGNC"
|
25
|
-
homepage_fmt =
|
26
|
-
"http://ftp.ebi.ac.uk/pub/databases/genenames/hgnc/"
|
27
|
-
"archive/monthly/json/hgnc_complete_set_{version}.json"
|
28
|
-
)
|
26
|
+
homepage_fmt = PATH + "hgnc_complete_set_{version}.json"
|
29
27
|
|
30
28
|
version_type = VersionType.date
|
31
29
|
|
32
30
|
def get(self) -> str:
|
33
|
-
"""Get the latest HGNC version number."""
|
34
|
-
|
31
|
+
"""Get the latest monthly HGNC version number."""
|
32
|
+
res = requests.get(URL, timeout=5)
|
33
|
+
items = res.json()["items"]
|
35
34
|
return max(
|
36
|
-
|
37
|
-
for
|
38
|
-
if
|
35
|
+
item["name"].removeprefix(PREFIX).removesuffix(SUFFIX)
|
36
|
+
for item in items
|
37
|
+
if (name := item["name"]).startswith(PREFIX) and name.endswith(SUFFIX)
|
39
38
|
)
|
40
39
|
|
41
40
|
|
@@ -0,0 +1,30 @@
|
|
1
|
+
"""A getter for ICD10."""
|
2
|
+
|
3
|
+
import requests
|
4
|
+
|
5
|
+
from bioversions.utils import Getter, VersionType
|
6
|
+
|
7
|
+
__all__ = [
|
8
|
+
"ICD10Getter",
|
9
|
+
]
|
10
|
+
|
11
|
+
URL = "https://icd.who.int/browse10/"
|
12
|
+
|
13
|
+
|
14
|
+
class ICD10Getter(Getter):
|
15
|
+
"""A getter for ICD10."""
|
16
|
+
|
17
|
+
bioregistry_id = "icd10"
|
18
|
+
name = "International Classification of Diseases, 10th Revision"
|
19
|
+
version_type = VersionType.date
|
20
|
+
date_version_fmt = "%Y"
|
21
|
+
|
22
|
+
def get(self) -> str:
|
23
|
+
"""Get the latest ICD10 version number."""
|
24
|
+
response = requests.get(URL, allow_redirects=True, timeout=15)
|
25
|
+
final_url = response.url
|
26
|
+
return final_url[len("https://icd.who.int/browse10/") :].split("/")[0]
|
27
|
+
|
28
|
+
|
29
|
+
if __name__ == "__main__":
|
30
|
+
ICD10Getter.print()
|
@@ -0,0 +1,30 @@
|
|
1
|
+
"""A getter for ICD11."""
|
2
|
+
|
3
|
+
import requests
|
4
|
+
|
5
|
+
from bioversions.utils import Getter, VersionType
|
6
|
+
|
7
|
+
__all__ = [
|
8
|
+
"ICD11Getter",
|
9
|
+
]
|
10
|
+
|
11
|
+
URL = "https://icd.who.int/browse/latest-release/mms/en"
|
12
|
+
|
13
|
+
|
14
|
+
class ICD11Getter(Getter):
|
15
|
+
"""A getter for ICD11."""
|
16
|
+
|
17
|
+
bioregistry_id = "icd11"
|
18
|
+
name = "International Classification of Diseases, 11th Revision"
|
19
|
+
version_type = VersionType.date
|
20
|
+
date_version_fmt = "%Y-%m"
|
21
|
+
|
22
|
+
def get(self) -> str:
|
23
|
+
"""Get the latest ICD11 version number."""
|
24
|
+
response = requests.get(URL, allow_redirects=True, timeout=15)
|
25
|
+
final_url = response.url
|
26
|
+
return final_url[len("https://icd.who.int/browse/") :].split("/")[0]
|
27
|
+
|
28
|
+
|
29
|
+
if __name__ == "__main__":
|
30
|
+
ICD11Getter.print()
|
@@ -0,0 +1,30 @@
|
|
1
|
+
"""A getter for ICF."""
|
2
|
+
|
3
|
+
import requests
|
4
|
+
|
5
|
+
from bioversions.utils import Getter, VersionType
|
6
|
+
|
7
|
+
__all__ = [
|
8
|
+
"ICFGetter",
|
9
|
+
]
|
10
|
+
|
11
|
+
URL = "https://icd.who.int/browse/latest-release/icf/en"
|
12
|
+
|
13
|
+
|
14
|
+
class ICFGetter(Getter):
|
15
|
+
"""A getter for ICF."""
|
16
|
+
|
17
|
+
bioregistry_id = "icf"
|
18
|
+
name = "International Classification of Functioning, Disability and Health"
|
19
|
+
version_type = VersionType.date
|
20
|
+
date_version_fmt = "%Y-%m"
|
21
|
+
|
22
|
+
def get(self) -> str:
|
23
|
+
"""Get the latest ICF version number."""
|
24
|
+
response = requests.get(URL, allow_redirects=True, timeout=15)
|
25
|
+
final_url = response.url
|
26
|
+
return final_url[len("https://icd.who.int/browse/") :].split("/")[0]
|
27
|
+
|
28
|
+
|
29
|
+
if __name__ == "__main__":
|
30
|
+
ICFGetter.print()
|
bioversions/sources/intact.py
CHANGED
bioversions/sources/interpro.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""A getter for InterPro."""
|
4
2
|
|
5
3
|
import re
|
@@ -35,7 +33,7 @@ class InterProGetter(Getter):
|
|
35
33
|
if line.startswith("Release") and not line.startswith("Release Notes"):
|
36
34
|
line = line[len("Release ") :]
|
37
35
|
version, rest = line.split(",", 1)
|
38
|
-
return
|
36
|
+
return {"version": version, "date": _process_line(rest)}
|
39
37
|
raise ValueError
|
40
38
|
|
41
39
|
|
bioversions/sources/itis.py
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""A getter for ITIS."""
|
4
2
|
|
5
|
-
|
3
|
+
import datetime
|
4
|
+
|
5
|
+
import requests
|
6
6
|
|
7
|
-
from bioversions.utils import Getter, VersionType
|
7
|
+
from bioversions.utils import Getter, VersionType
|
8
8
|
|
9
9
|
__all__ = [
|
10
10
|
"ITISGetter",
|
11
11
|
]
|
12
12
|
|
13
|
-
URL = "https://itis.gov/
|
13
|
+
URL = "https://www.itis.gov/DisplayPresentDate"
|
14
14
|
|
15
15
|
|
16
16
|
class ITISGetter(Getter):
|
@@ -18,19 +18,12 @@ class ITISGetter(Getter):
|
|
18
18
|
|
19
19
|
bioregistry_id = "itis"
|
20
20
|
name = "ITIS"
|
21
|
-
date_fmt = "%d-%B-%Y"
|
22
21
|
version_type = VersionType.date
|
23
22
|
|
24
|
-
def get(self) ->
|
23
|
+
def get(self) -> datetime.datetime:
|
25
24
|
"""Get the latest ITIS version number."""
|
26
|
-
|
27
|
-
|
28
|
-
for cell in cells:
|
29
|
-
if "Database download files are currently from the " not in cell.text:
|
30
|
-
continue
|
31
|
-
bolds = list(cell.find_all("b"))
|
32
|
-
return bolds[1].text
|
33
|
-
raise ValueError
|
25
|
+
res = requests.get(URL, timeout=3).text
|
26
|
+
return datetime.datetime.strptime(res, "%d-%b-%Y")
|
34
27
|
|
35
28
|
|
36
29
|
if __name__ == "__main__":
|
bioversions/sources/kegg.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""A getter for KEGG."""
|
4
2
|
|
5
|
-
from
|
3
|
+
from collections.abc import Mapping
|
4
|
+
from typing import ClassVar
|
5
|
+
|
6
|
+
import bioregistry
|
6
7
|
|
7
8
|
from bioversions.utils import Getter, VersionType, get_soup
|
8
9
|
|
@@ -16,19 +17,19 @@ URL = "https://www.kegg.jp/kegg/docs/relnote.html"
|
|
16
17
|
class KEGGGetter(Getter):
|
17
18
|
"""A getter for KEGG."""
|
18
19
|
|
19
|
-
bioregistry_id = "kegg.pathway"
|
20
20
|
name = "KEGG"
|
21
21
|
date_fmt = "%B %d, %Y"
|
22
22
|
version_type = VersionType.semver_minor
|
23
|
+
collection: ClassVar[list[str]] = ["kegg", *bioregistry.get_has_parts("kegg")]
|
23
24
|
|
24
25
|
def get(self) -> Mapping[str, str]:
|
25
26
|
"""Get the latest KEGG version number."""
|
26
27
|
soup = get_soup(URL)
|
27
28
|
header = soup.find("h4")
|
28
29
|
sibling = header.next_sibling.strip()
|
29
|
-
version, date =
|
30
|
+
version, date = (part.strip() for part in sibling.split(",", 1))
|
30
31
|
version = version[len("Release ") :]
|
31
|
-
return
|
32
|
+
return {"version": version, "date": date}
|
32
33
|
|
33
34
|
|
34
35
|
if __name__ == "__main__":
|
bioversions/sources/mesh.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""A getter for MeSH."""
|
4
2
|
|
5
3
|
import ftplib
|
@@ -10,6 +8,10 @@ __all__ = [
|
|
10
8
|
"MeshGetter",
|
11
9
|
]
|
12
10
|
|
11
|
+
#: In 2024 and before, these were .gz, but after
|
12
|
+
#: became .xml files
|
13
|
+
SUFFIXES = [".xml", ".xml.gz", ".gz"]
|
14
|
+
|
13
15
|
|
14
16
|
class MeshGetter(Getter):
|
15
17
|
"""A getter for MeSH."""
|
@@ -24,9 +26,12 @@ class MeshGetter(Getter):
|
|
24
26
|
with ftplib.FTP("nlmpubs.nlm.nih.gov") as ftp:
|
25
27
|
ftp.login()
|
26
28
|
ftp.cwd("/online/mesh/MESH_FILES/xmlmesh/")
|
27
|
-
for name, _ in ftp.mlsd()
|
28
|
-
|
29
|
-
|
29
|
+
names = [name for name, _ in ftp.mlsd()]
|
30
|
+
|
31
|
+
for name in names:
|
32
|
+
for suffix in SUFFIXES:
|
33
|
+
if name.startswith("desc") and name.endswith(suffix):
|
34
|
+
return name[len("desc") : -len(suffix)]
|
30
35
|
raise ValueError
|
31
36
|
|
32
37
|
|
bioversions/sources/mgi.py
CHANGED
bioversions/sources/mirbase.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""A getter for miRBase."""
|
4
2
|
|
5
|
-
from
|
3
|
+
from typing import ClassVar
|
4
|
+
|
5
|
+
from bioversions.utils import Getter, VersionType, get_soup
|
6
6
|
|
7
7
|
__all__ = [
|
8
8
|
"MirbaseGetter",
|
@@ -18,14 +18,20 @@ class MirbaseGetter(Getter):
|
|
18
18
|
name = "miRBase"
|
19
19
|
homepage_fmt = "https://www.mirbase.org/download/PREVIOUS_RELEASES/{version}"
|
20
20
|
version_type = VersionType.semver_minor
|
21
|
+
collection: ClassVar[list[str]] = ["mirbase", "mirbase.family", "mirbase.mature"]
|
21
22
|
|
22
23
|
def get(self):
|
23
24
|
"""Get the latest miRBase version number."""
|
24
25
|
return "22.1"
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
|
27
|
+
|
28
|
+
def _old():
|
29
|
+
"""Get miRBase version number from the old server."""
|
30
|
+
# Old code, doesn't work anymore because miRBase site deleted
|
31
|
+
# most of their FTP server and downloads
|
32
|
+
url = "http://www.mirbase.org/download_readme/"
|
33
|
+
soup = get_soup(url, verify=False)
|
34
|
+
return soup.find("p").text.splitlines()[0].split()[-1]
|
29
35
|
|
30
36
|
|
31
37
|
if __name__ == "__main__":
|
bioversions/sources/moalmanac.py
CHANGED
bioversions/sources/msigdb.py
CHANGED
bioversions/sources/ncit.py
CHANGED
@@ -1,9 +1,6 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""A getter for the NCI Thesaurus."""
|
4
2
|
|
5
3
|
import re
|
6
|
-
from typing import Dict
|
7
4
|
|
8
5
|
from ..utils import Getter, VersionType, get_soup
|
9
6
|
|
@@ -25,7 +22,7 @@ class NCItGetter(Getter):
|
|
25
22
|
date_fmt = "%Y-%m-%d"
|
26
23
|
version_type = VersionType.other
|
27
24
|
|
28
|
-
def get(self) ->
|
25
|
+
def get(self) -> dict[str, str]:
|
29
26
|
"""Get the latest NCIt version number."""
|
30
27
|
soup = get_soup(URL)
|
31
28
|
version_str = soup.find("span", {"class": "vocabularynamelong_ncit"}).contents[0]
|
bioversions/sources/npass.py
CHANGED
bioversions/sources/obo.py
CHANGED
@@ -1,17 +1,15 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""Getters for OBO ontologies."""
|
4
2
|
|
5
|
-
from
|
3
|
+
from collections.abc import Iterable
|
6
4
|
|
7
5
|
from bioversions.utils import Getter, OBOFoundryGetter, VersionType
|
8
6
|
|
9
7
|
__all__ = [
|
10
|
-
"iter_obo_getters",
|
11
8
|
"ChebiGetter",
|
12
|
-
"GoGetter",
|
13
9
|
"DoidGetter",
|
10
|
+
"GoGetter",
|
14
11
|
"PrGetter",
|
12
|
+
"iter_obo_getters",
|
15
13
|
]
|
16
14
|
|
17
15
|
|
@@ -56,7 +54,7 @@ class PrGetter(OBOFoundryGetter):
|
|
56
54
|
homepage_fmt = "https://proconsortium.org/download/release_{version}/"
|
57
55
|
|
58
56
|
|
59
|
-
def iter_obo_getters() -> Iterable[
|
57
|
+
def iter_obo_getters() -> Iterable[type[Getter]]:
|
60
58
|
"""Iterate over OBO getters."""
|
61
59
|
yield from OBOFoundryGetter.__subclasses__()
|
62
60
|
|
bioversions/sources/ols.py
CHANGED
@@ -1,9 +1,7 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""Get versions from the OLS."""
|
4
2
|
|
5
3
|
import logging
|
6
|
-
from
|
4
|
+
from collections.abc import Iterable, Mapping
|
7
5
|
|
8
6
|
import bioregistry
|
9
7
|
from bioregistry.external.ols import get_ols_processing
|
@@ -16,7 +14,7 @@ logger = logging.getLogger(__name__)
|
|
16
14
|
ols_processing = get_ols_processing()
|
17
15
|
|
18
16
|
|
19
|
-
def _get_version_type(bioregistry_id: str) ->
|
17
|
+
def _get_version_type(bioregistry_id: str) -> VersionType | None:
|
20
18
|
ols_id = bioregistry.get_ols_prefix(bioregistry_id)
|
21
19
|
ols_config = ols_processing.get(ols_id)
|
22
20
|
if ols_config is None:
|
@@ -33,7 +31,7 @@ def _get_version_type(bioregistry_id: str) -> Optional[VersionType]:
|
|
33
31
|
return None
|
34
32
|
|
35
33
|
|
36
|
-
def make_ols_getter(bioregistry_id: str) ->
|
34
|
+
def make_ols_getter(bioregistry_id: str) -> type[Getter] | None:
|
37
35
|
"""Make a getter from OLS."""
|
38
36
|
ols_id = bioregistry.get_ols_prefix(bioregistry_id)
|
39
37
|
if ols_id is None:
|
@@ -66,14 +64,14 @@ def make_ols_getter(bioregistry_id: str) -> Optional[Type[Getter]]:
|
|
66
64
|
name = _name
|
67
65
|
version_type = _version_type # type:ignore
|
68
66
|
|
69
|
-
def get(self) ->
|
67
|
+
def get(self) -> str | Mapping[str, str]:
|
70
68
|
"""Get the version from the Bioregistry."""
|
71
69
|
return version
|
72
70
|
|
73
71
|
return OlsGetter
|
74
72
|
|
75
73
|
|
76
|
-
def iter_ols_getters() -> Iterable[
|
74
|
+
def iter_ols_getters() -> Iterable[type[Getter]]:
|
77
75
|
"""Iterate over OLS getters."""
|
78
76
|
for bioregistry_id in bioregistry.read_registry():
|
79
77
|
yv = make_ols_getter(bioregistry_id)
|
@@ -81,7 +79,7 @@ def iter_ols_getters() -> Iterable[Type[Getter]]:
|
|
81
79
|
yield yv
|
82
80
|
|
83
81
|
|
84
|
-
def extend_ols_getters(getters:
|
82
|
+
def extend_ols_getters(getters: list[type[Getter]]) -> None:
|
85
83
|
"""Extend the getters, without adding duplicates."""
|
86
84
|
for ols_getter in iter_ols_getters():
|
87
85
|
if any(getter.bioregistry_id == ols_getter.bioregistry_id for getter in getters):
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"""A getter for the OMIM."""
|
2
|
+
|
3
|
+
import datetime
|
4
|
+
from typing import ClassVar
|
5
|
+
|
6
|
+
from bioversions.utils import Getter, VersionType, get_soup
|
7
|
+
|
8
|
+
__all__ = [
|
9
|
+
"OMIMGetter",
|
10
|
+
]
|
11
|
+
|
12
|
+
|
13
|
+
class OMIMGetter(Getter):
|
14
|
+
"""A getter for OMIM."""
|
15
|
+
|
16
|
+
name = "Online Mendelian Inheritance in Man"
|
17
|
+
version_type = VersionType.date
|
18
|
+
collection: ClassVar[list[str]] = ["omim.ps", "omim"]
|
19
|
+
|
20
|
+
def get(self) -> datetime.datetime:
|
21
|
+
"""Get the latest OMIM version number."""
|
22
|
+
soup = get_soup("https://omim.org/")
|
23
|
+
for tag in soup.find_all("h5"):
|
24
|
+
text = tag.text.strip()
|
25
|
+
if text.startswith("Updated"):
|
26
|
+
rv = text[len("Updated") :].strip()
|
27
|
+
rv = rv.replace("nd", "").replace("st", "").replace("rd", "").replace("th", "")
|
28
|
+
return datetime.datetime.strptime(rv, "%B %d, %Y")
|
29
|
+
raise ValueError
|
30
|
+
|
31
|
+
|
32
|
+
if __name__ == "__main__":
|
33
|
+
OMIMGetter.print()
|
bioversions/sources/oncotree.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""A getter for OncoTree."""
|
4
2
|
|
5
3
|
import requests
|
@@ -22,10 +20,12 @@ class OncoTreeGetter(Getter):
|
|
22
20
|
|
23
21
|
def get(self) -> str:
|
24
22
|
"""Get the latest OncoTree version number."""
|
25
|
-
res = requests.get(
|
23
|
+
res = requests.get(
|
24
|
+
"http://oncotree.mskcc.org/api/versions", params={"format": "json"}, timeout=5
|
25
|
+
)
|
26
26
|
res_json = res.json()
|
27
27
|
version = next(
|
28
|
-
|
28
|
+
r["release_date"] for r in res_json if r["api_identifier"] == "oncotree_latest_stable"
|
29
29
|
)
|
30
30
|
return version
|
31
31
|
|
bioversions/sources/pathbank.py
CHANGED
bioversions/sources/pfam.py
CHANGED
bioversions/sources/pombase.py
CHANGED
bioversions/sources/pr.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""A getter for the Protein Ontology."""
|
4
2
|
|
5
3
|
from bioversions.utils import Getter, VersionType, get_soup
|
@@ -26,7 +24,7 @@ class PRGetter(Getter):
|
|
26
24
|
rows = soup.find("table", **{"class": "nrm11"}).find_all("tr")
|
27
25
|
row = list(rows)[2]
|
28
26
|
version_cell, date_cell, *_ = list(row.find_all("td"))
|
29
|
-
return
|
27
|
+
return {"version": version_cell.text.strip(), "date": date_cell.text.strip()}
|
30
28
|
|
31
29
|
|
32
30
|
if __name__ == "__main__":
|
bioversions/sources/pubchem.py
CHANGED
bioversions/sources/reactome.py
CHANGED
bioversions/sources/rfam.py
CHANGED
bioversions/sources/rgd.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""A getter for RGD."""
|
4
2
|
|
5
3
|
import requests
|
@@ -10,7 +8,7 @@ __all__ = [
|
|
10
8
|
"RGDGetter",
|
11
9
|
]
|
12
10
|
|
13
|
-
URL = "https://download.rgd.mcw.edu/data_release/
|
11
|
+
URL = "https://download.rgd.mcw.edu/data_release/GENES_RAT.txt"
|
14
12
|
|
15
13
|
|
16
14
|
class RGDGetter(Getter):
|
bioversions/sources/rhea.py
CHANGED
@@ -1,9 +1,6 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""A getter for Rhea."""
|
4
2
|
|
5
3
|
import requests
|
6
|
-
import requests_ftp
|
7
4
|
|
8
5
|
from bioversions.utils import Getter, VersionType
|
9
6
|
|
@@ -11,9 +8,7 @@ __all__ = [
|
|
11
8
|
"RheaGetter",
|
12
9
|
]
|
13
10
|
|
14
|
-
|
15
|
-
|
16
|
-
VERSION_FILE = "ftp://ftp.expasy.org/databases/rhea/rhea-release.properties"
|
11
|
+
VERSION_FILE = "https://ftp.expasy.org/databases/rhea/rhea-release.properties"
|
17
12
|
|
18
13
|
|
19
14
|
class RheaGetter(Getter):
|
bioversions/sources/rxnorm.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
1
|
"""A getter for RxNorm."""
|
4
2
|
|
5
3
|
from datetime import datetime
|
@@ -24,7 +22,7 @@ class RxNormGetter(Getter):
|
|
24
22
|
def get(self) -> datetime:
|
25
23
|
"""Get the latest RxNorm version number."""
|
26
24
|
soup = get_soup(URL)
|
27
|
-
raw_version = soup.find("th", {"class": "current"}).contents[2]
|
25
|
+
raw_version = soup.find("th", {"class": "current"}).contents[2].strip()
|
28
26
|
raw_fmt = "%B %d, %Y"
|
29
27
|
return datetime.strptime(raw_version, raw_fmt)
|
30
28
|
|