From de2b1e373904aab45badfc8a0c410e2ea324f99b Mon Sep 17 00:00:00 2001 From: Martin Jediny Date: Sun, 19 May 2024 15:54:21 +0200 Subject: [PATCH] Use default SQC URL --- examples/simple.py | 19 ------------------- examples/test.mmcif | 0 sqclib/client.py | 12 +++++++++--- 3 files changed, 9 insertions(+), 22 deletions(-) delete mode 100644 examples/simple.py delete mode 100644 examples/test.mmcif diff --git a/examples/simple.py b/examples/simple.py deleted file mode 100644 index 3fce527..0000000 --- a/examples/simple.py +++ /dev/null @@ -1,19 +0,0 @@ -import os -import sqclib - -access_key = os.environ.get("SQC_ACCESS_KEY") -secret_key = os.environ.get("SQC_SECRET_KEY") - -sqc = sqclib.SQCClient( - "sqc-minio.dyn.cloud.e-infra.cz", - access_key=access_key, - secret_key=secret_key, -) - -try: - res = sqc.validate("test.mmcif") - print(res) - -except sqclib.SQCException: - print("Something went awry") - raise diff --git a/examples/test.mmcif b/examples/test.mmcif deleted file mode 100644 index e69de29..0000000 diff --git a/sqclib/client.py b/sqclib/client.py index 1afe4e3..d0bdcac 100644 --- a/sqclib/client.py +++ b/sqclib/client.py @@ -35,24 +35,30 @@ class SQCClient: Client used for communication with the SQC server. Args: - url (str): URL of the minio server access_key (str): Access key provided by SQC administrators. secret_key (str): Secret key provided by SQC administrators. + url (str, optional): URL of the minio server. Public MetaCentrum instance by default. secure (bool, optional): Use HTTPS for communication. `True` by default. Examples: >>> client = SQCClient( - 'https://sqc-minio.dyn.cloud.e-infra.cz', 'access_key', 'secret_key', + url='https://sqc-minio.dyn.cloud.e-infra.cz', secure=True, ) >>> client.validate('./struct.mmcif') {'results': 'ok'} """ - def __init__(self, url: str, access_key: str, secret_key: str, secure=True) -> None: + def __init__( + self, + access_key: str, + secret_key: str, + url: str = "https://sqc-minio.dyn.cloud.e-infra.cz", + secure=True, + ) -> None: self._minio = minio.Minio( url, access_key=access_key,