diff --git a/docs/_data/versions.yml b/docs/_data/versions.yml index 9b8a6995..c6f0772a 100644 --- a/docs/_data/versions.yml +++ b/docs/_data/versions.yml @@ -3,6 +3,9 @@ - homepage: https://downloads.thebiogrid.org/BioGRID/Release-Archive/BIOGRID-4.2.192 retrieved: '2020-12-11' version: 4.2.192 + - homepage: https://downloads.thebiogrid.org/BioGRID/Release-Archive/BIOGRID-4.2.193 + retrieved: '2021-01-02' + version: 4.2.193 - name: Cell Ontology releases: - retrieved: '2020-12-22' @@ -11,6 +14,9 @@ releases: - retrieved: '2020-12-11' version: '194' + - homepage: ftp://ftp.ebi.ac.uk/pub/databases/chebi/archive/rel195/ + retrieved: '2021-01-02' + version: '195' - name: ChEBML releases: - date: 18/05/2020 @@ -43,6 +49,10 @@ releases: - retrieved: '2020-12-22' version: 9/18/2020 +- name: ExPASy + releases: + - retrieved: '2021-01-02' + version: 02-Dec-2020 - name: Gene Ontology releases: - retrieved: '2020-12-11' @@ -101,6 +111,11 @@ - homepage: ftp://ftp.ebi.ac.uk/pub/databases/Rfam/14.4/ retrieved: '2020-12-25' version: '14.4' +- name: UniProt + releases: + - homepage: ftp://ftp.uniprot.org/pub/databases/uniprot/previous_releases/release-2020_06/ + retrieved: '2021-01-02' + version: '2020_06' - name: WikiPathways releases: - homepage: http://data.wikipathways.org/20201210/ diff --git a/src/bioversions/sources/__init__.py b/src/bioversions/sources/__init__.py index a1615e0c..02806b6b 100644 --- a/src/bioversions/sources/__init__.py +++ b/src/bioversions/sources/__init__.py @@ -20,6 +20,7 @@ from .pfam import PfamGetter from .reactome import ReactomeGetter from .rfam import RfamGetter +from .uniprot import UniProtGetter from .wikipathways import WikiPathwaysGetter from ..utils import Bioversion, Getter, norm, refresh_daily @@ -57,6 +58,7 @@ PfamGetter, ClGetter, ZfaGetter, + UniProtGetter, ] getters = sorted(getters, key=lambda cls: cls.__name__.lower()) diff --git a/src/bioversions/sources/uniprot.py b/src/bioversions/sources/uniprot.py new file mode 100644 index 00000000..3321a3c9 --- /dev/null +++ b/src/bioversions/sources/uniprot.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- + +"""A getter for UniProt.""" + +from xml.etree import ElementTree # noqa:S405 + +import requests +import requests_ftp + +from bioversions.utils import Getter + +__all__ = [ + 'UniProtGetter', +] + +requests_ftp.monkeypatch_session() + + +class UniProtGetter(Getter): + """A getter for UniProt.""" + + name = 'UniProt' + homepage_fmt = 'ftp://ftp.uniprot.org/pub/databases/uniprot/previous_releases/release-{version}/' + date_version_fmt = '%Y_%m' + + def get(self): + """Get the latest UniProt version number.""" + session = requests.Session() + f = session.get('ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/RELEASE.metalink') + tree = ElementTree.fromstring(f.text) # noqa:S314 + version_tag = tree.find('{http://www.metalinker.org/}version') + return version_tag.text + + +if __name__ == '__main__': + UniProtGetter.print()