bioversions 0.6.0__py3-none-any.whl → 0.6.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "annotations": {
3
- "revision": 864,
4
- "date": "2024-12-08",
3
+ "revision": 865,
4
+ "date": "2024-12-09",
5
5
  "author": "runner"
6
6
  },
7
7
  "database": [
@@ -5491,6 +5491,11 @@
5491
5491
  "retrieved": "2024-12-03",
5492
5492
  "version": "2024-11-01",
5493
5493
  "homepage": "https://storage.googleapis.com/public-download-files/hgnc/archive/archive/monthly/json/hgnc_complete_set_2024-11-01.json"
5494
+ },
5495
+ {
5496
+ "retrieved": "2024-12-09",
5497
+ "version": "2024-12-03",
5498
+ "homepage": "https://storage.googleapis.com/public-download-files/hgnc/archive/archive/monthly/json/hgnc_complete_set_2024-12-03.json"
5494
5499
  }
5495
5500
  ],
5496
5501
  "name": "HGNC",
@@ -7047,6 +7052,11 @@
7047
7052
  "retrieved": "2023-12-01",
7048
7053
  "version": "2024",
7049
7054
  "homepage": "ftp://nlmpubs.nlm.nih.gov/online/mesh/2024"
7055
+ },
7056
+ {
7057
+ "retrieved": "2024-12-09",
7058
+ "version": "2025",
7059
+ "homepage": "ftp://nlmpubs.nlm.nih.gov/online/mesh/2025"
7050
7060
  }
7051
7061
  ],
7052
7062
  "name": "MeSH",
@@ -14854,6 +14864,10 @@
14854
14864
  {
14855
14865
  "retrieved": "2024-12-08",
14856
14866
  "version": "2024-12-08"
14867
+ },
14868
+ {
14869
+ "retrieved": "2024-12-09",
14870
+ "version": "2024-12-09"
14857
14871
  }
14858
14872
  ],
14859
14873
  "name": "SwissLipids",
@@ -1,6 +1,5 @@
1
1
  """A getter for HGNC."""
2
2
 
3
- import datetime
4
3
  import logging
5
4
 
6
5
  import requests
@@ -14,7 +13,8 @@ __all__ = [
14
13
  logger = logging.getLogger(__name__)
15
14
 
16
15
  PATH = "https://storage.googleapis.com/public-download-files/hgnc/archive/archive/monthly/json/"
17
- PREFIX = "hgnc_complete_set_"
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_"
18
18
  SUFFIX = ".json"
19
19
 
20
20
 
@@ -28,19 +28,14 @@ class HGNCGetter(Getter):
28
28
  version_type = VersionType.date
29
29
 
30
30
  def get(self) -> str:
31
- """Get the latest HGNC version number."""
32
- today = datetime.date.today()
33
- this_year = int(today.strftime("%Y"))
34
- this_month = int(today.strftime("%m"))
35
- maybe = today.strftime("%Y-%m-01")
36
- res = requests.head(self.homepage_fmt.format(version=maybe), timeout=15)
37
- if res.status_code == 200:
38
- return maybe
39
- if this_month == 1:
40
- maybe_last_month = f"{this_year - 1}-12-01"
41
- else:
42
- maybe_last_month = f"{this_year}-{this_month - 1}-01"
43
- return maybe_last_month
31
+ """Get the latest monthly HGNC version number."""
32
+ res = requests.get(URL, timeout=5)
33
+ items = res.json()["items"]
34
+ return max(
35
+ item["name"].removeprefix(PREFIX).removesuffix(SUFFIX)
36
+ for item in items
37
+ if (name := item["name"]).startswith(PREFIX) and name.endswith(SUFFIX)
38
+ )
44
39
 
45
40
 
46
41
  if __name__ == "__main__":
@@ -8,6 +8,10 @@ __all__ = [
8
8
  "MeshGetter",
9
9
  ]
10
10
 
11
+ #: In 2024 and before, these were .gz, but after
12
+ #: became .xml files
13
+ SUFFIXES = [".xml", ".xml.gz", ".gz"]
14
+
11
15
 
12
16
  class MeshGetter(Getter):
13
17
  """A getter for MeSH."""
@@ -22,9 +26,12 @@ class MeshGetter(Getter):
22
26
  with ftplib.FTP("nlmpubs.nlm.nih.gov") as ftp:
23
27
  ftp.login()
24
28
  ftp.cwd("/online/mesh/MESH_FILES/xmlmesh/")
25
- for name, _ in ftp.mlsd():
26
- if name.startswith("desc") and name.endswith(".gz"):
27
- return name[len("desc") : -len(".gz")]
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)]
28
35
  raise ValueError
29
36
 
30
37
 
bioversions/version.py CHANGED
@@ -7,7 +7,7 @@ __all__ = [
7
7
  "VERSION",
8
8
  ]
9
9
 
10
- VERSION = "0.6.0"
10
+ VERSION = "0.6.1"
11
11
 
12
12
 
13
13
  def get_git_hash() -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bioversions
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Summary: Get the current version for biological databases
5
5
  Project-URL: Bug Tracker, https://github.com/biopragmatics/bioversions/issues
6
6
  Project-URL: Homepage, https://github.com/biopragmatics/bioversions
@@ -6,11 +6,11 @@ bioversions/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  bioversions/slack_client.py,sha256=p9HmnyRCVuQvje0RbdDK9QuRlSw__WwFCJ8Be9cIkzM,1209
7
7
  bioversions/twitter_client.py,sha256=9d5Am0FSs7_EgGdjkxqpo98vPir9rjIXIxhZMmLgK5Q,1285
8
8
  bioversions/utils.py,sha256=x5d4p12VMlD5F8-y_J6JE5sct7BCV1d-zO-y5bSamSM,10342
9
- bioversions/version.py,sha256=sDNDSFIE7ThrJGabQa02d6NA_lTyKrKJ7mKsLm62e_g,585
9
+ bioversions/version.py,sha256=-d0FUcxG8EJX_yLIM1K5O_GnwbolvcgvpeQwUAk-daQ,585
10
10
  bioversions/wsgi.py,sha256=-F7pUZipcQgj1T_f-9QCZBVdQ9sZBH93x3hxh9h7klU,794
11
11
  bioversions/resources/__init__.py,sha256=Nxw6w6_gRC4B_JwvbAAKpNR2rIpkNRZ5UkBIMdNqldY,1659
12
12
  bioversions/resources/update.py,sha256=btT_tdp0NKBRdshf4VuOe-vHWq0QQtcWWFcXS8QUfLU,3626
13
- bioversions/resources/versions.json,sha256=et5337SBwDq0fe5H6iEZM_iZKjLjkFWo0E1fM0xnJfY,483299
13
+ bioversions/resources/versions.json,sha256=pc58PpzZlk1miz5prn_srs3n2e2Hhyw5wSkunCVWIpQ,483783
14
14
  bioversions/sources/__init__.py,sha256=pXONlDoxWIVRTSdCN3RDr3aMY38QGPOt0EwPAMCaIF8,6248
15
15
  bioversions/sources/antibodyregistry.py,sha256=6GF_9v8A_8Y4o6_nsZ9cAOP5vK3ZbPQ5qeL99UefR80,680
16
16
  bioversions/sources/bigg.py,sha256=iVrxyvKiEIUXs6FM2AiLDYa-yYDNGMONmiIv_R6KBg4,661
@@ -32,7 +32,7 @@ bioversions/sources/expasy.py,sha256=5C9m9Okygaq2D7zuuTnkOD4V24QU4C89ldztfLtiqnI
32
32
  bioversions/sources/flybase.py,sha256=L1qs0OF0OhjdknwV6DfvnnlxP37Z09hjuk-pz1Un2GM,754
33
33
  bioversions/sources/gtdb.py,sha256=lbtmSh4uhy6-Ve_slwO-Y7_wHRVySuof1I_rR-FQ05k,1001
34
34
  bioversions/sources/guidetopharmacology.py,sha256=WAasA6ZlyqJiqP70VrrCEpi2-JW7UMrUunAuE6pTk_g,1377
35
- bioversions/sources/hgnc.py,sha256=FPrpdsNRw0sj8GJ-tq6vzh0Zpmp8cKXgZDS8C5HxobU,1183
35
+ bioversions/sources/hgnc.py,sha256=Wy0M8aT-SKsMKUWxEdPpWs32SjL7UZyiANLtCQC4Wp0,1099
36
36
  bioversions/sources/homologene.py,sha256=TaW0A33PLS4804zrRWZKDmo_zwEzK9bxX_zAiaUmd5w,622
37
37
  bioversions/sources/icd10.py,sha256=86zl9yxeUyy3WKgQS55I-1bK-kegH59sZFiwYGKFaAU,703
38
38
  bioversions/sources/icd11.py,sha256=a8kpwP6P3-Qowj6fGFFlsbL1ibhaWN48wez_qANiCE0,723
@@ -41,7 +41,7 @@ bioversions/sources/intact.py,sha256=BuZ-2n6O7e3HT2PrHHPbBkhmXa54Mj19kmJcdv9PfAU
41
41
  bioversions/sources/interpro.py,sha256=H6dZI71gUXo7L2YefCTiJD4quQRAvyYh5nDDbh2iuvE,1238
42
42
  bioversions/sources/itis.py,sha256=hh5zg61OAJIC76-5pwR5gd9YyWWUy_FY53X9vEAwLIQ,815
43
43
  bioversions/sources/kegg.py,sha256=dI7uQpaZh65rZOdutqcXNOkxn3HGwDNzaXyUhxiTdRU,905
44
- bioversions/sources/mesh.py,sha256=OWt3dOe8OjVxnQ6DBIq2dFRMKTPjwsvygYc6LrBUnPk,782
44
+ bioversions/sources/mesh.py,sha256=XqjPU5UJgOHVc28c_6N7RiJd1F9RoUGPXGmmIaNopvM,971
45
45
  bioversions/sources/mgi.py,sha256=TX-V0xcWFmktssjRldjYb591HCtoheY99w0FTH2cIZk,841
46
46
  bioversions/sources/mirbase.py,sha256=q3C6-Cy-vELyJCQCnpg4pveoRrlYfqgb4313mHG5Cp4,996
47
47
  bioversions/sources/moalmanac.py,sha256=DMotSYD4sGOTZaJgn_iPeUfEdhjlgmzoKKLYS-L6Tro,749
@@ -73,8 +73,8 @@ bioversions/sources/wikipathways.py,sha256=STw8Bivc3IZLYIx-KwpxHLUmRTqNfHm0wQywD
73
73
  bioversions/sources/zfin.py,sha256=3Ooz3lDx8J42OAoyU8eJI-fRnMRiYyUMcj4fDE5DVLQ,683
74
74
  bioversions/templates/base.html,sha256=AKB6aT39U9VtOM2zvW_Um5IgYO9Ky-CLpByxy5XXO5M,713
75
75
  bioversions/templates/home.html,sha256=z98FSslCRP2K39xbHpSPgk19j7Z21PSbRGAtaXI0Md0,2756
76
- bioversions-0.6.0.dist-info/METADATA,sha256=tiPzbnLwFUCnp5amhoolYKR5Tt2_bayD9YxwC3bbuCc,19674
77
- bioversions-0.6.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
78
- bioversions-0.6.0.dist-info/entry_points.txt,sha256=A3qrS-nvKNZPZWQbYlmsmiDTge524C4yR-arRJwdHls,53
79
- bioversions-0.6.0.dist-info/licenses/LICENSE,sha256=QcgJZKGxlW5BwBNnCBL8VZLVtRvXs81Ch9lJRQSIpJg,1076
80
- bioversions-0.6.0.dist-info/RECORD,,
76
+ bioversions-0.6.1.dist-info/METADATA,sha256=_rYarTvglAgtHkGzC38Qx_x8j2bPO2MigkBHQCJQqfE,19674
77
+ bioversions-0.6.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
78
+ bioversions-0.6.1.dist-info/entry_points.txt,sha256=A3qrS-nvKNZPZWQbYlmsmiDTge524C4yR-arRJwdHls,53
79
+ bioversions-0.6.1.dist-info/licenses/LICENSE,sha256=QcgJZKGxlW5BwBNnCBL8VZLVtRvXs81Ch9lJRQSIpJg,1076
80
+ bioversions-0.6.1.dist-info/RECORD,,