mpcontribs-client 5.8.4__py3-none-any.whl → 5.9.0__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.
@@ -61,6 +61,7 @@ from tempfile import gettempdir
61
61
  from plotly.express._chart_types import line as line_chart
62
62
  from cachetools import cached, LRUCache
63
63
  from cachetools.keys import hashkey
64
+ from pymatgen.core import SETTINGS
64
65
 
65
66
  RETRIES = 3
66
67
  MAX_WORKERS = 3
@@ -886,7 +887,9 @@ class Client(SwaggerClient):
886
887
  host = os.environ.get("MPCONTRIBS_API_HOST", DEFAULT_HOST)
887
888
 
888
889
  if not apikey:
889
- apikey = os.environ.get("MPCONTRIBS_API_KEY")
890
+ apikey = os.environ.get("MPCONTRIBS_API_KEY", SETTINGS.get("PMG_MAPI_KEY"))
891
+ if apikey and len(apikey) != 32:
892
+ raise MPContribsClientError(f"Invalid API key: {apikey}")
890
893
 
891
894
  if apikey and headers:
892
895
  apikey = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mpcontribs-client
3
- Version: 5.8.4
3
+ Version: 5.9.0
4
4
  Summary: client library for MPContribs API
5
5
  Home-page: https://github.com/materialsproject/MPContribs/tree/master/mpcontribs-client
6
6
  Author: Patrick Huck
@@ -0,0 +1,6 @@
1
+ mpcontribs/client/__init__.py,sha256=K4OCUoMpwJvkAbJvM03-TPd5wzQi0RkBpjd8WJBwP7w,96983
2
+ mpcontribs_client-5.9.0.dist-info/LICENSE,sha256=5tG0Niaqw2hnuyZZYkRXLSnfVrZA47COwduU_6caPLM,1074
3
+ mpcontribs_client-5.9.0.dist-info/METADATA,sha256=5zIrQcDW0whyINa0Vnq8PnRIlHvd8tdvyDjPt05p7LE,2572
4
+ mpcontribs_client-5.9.0.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
5
+ mpcontribs_client-5.9.0.dist-info/top_level.txt,sha256=t8R5L_Dg9oDQMh2gyRFdZGnrzZsr7OjCBTrhTcmimC8,11
6
+ mpcontribs_client-5.9.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.1.0)
2
+ Generator: setuptools (75.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,6 +0,0 @@
1
- mpcontribs/client/__init__.py,sha256=xvHBjJnbIEwA9Ubg9a_sbqp0zbG8rVCoKutiY_cA5M4,96799
2
- mpcontribs_client-5.8.4.dist-info/LICENSE,sha256=5tG0Niaqw2hnuyZZYkRXLSnfVrZA47COwduU_6caPLM,1074
3
- mpcontribs_client-5.8.4.dist-info/METADATA,sha256=L9NNJo4IpeKVPQoRnETAc0XuJgYHSA5wEzcPwhhe-gw,2572
4
- mpcontribs_client-5.8.4.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
5
- mpcontribs_client-5.8.4.dist-info/top_level.txt,sha256=t8R5L_Dg9oDQMh2gyRFdZGnrzZsr7OjCBTrhTcmimC8,11
6
- mpcontribs_client-5.8.4.dist-info/RECORD,,