Skip to content

Commit

Permalink
Merge branch 'main' into 56-update-code-to-match-new-api-spec
Browse files Browse the repository at this point in the history
  • Loading branch information
bschroeter committed Sep 19, 2024
2 parents 8232649 + 13a5841 commit 2b7c2c8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
16 changes: 16 additions & 0 deletions meorg_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,3 +482,19 @@ def success(self) -> bool:
True if successful, False otherwise.
"""
return self.last_response.status_code in mcc.HTTP_STATUS_SUCCESS_RANGE

def is_initialised(self, dev: bool = False) -> bool:
"""Check if the client is initialised.
NOTE: This does not check the login actually works.
Parameters
----------
dev : bool, optional
Use dev credentials, by default False
Returns
-------
bool
True if initialised, False otherwise.
"""
cred_filename = "credentials.json" if not dev else "credentials-dev.json"
cred_filepath = mu.get_user_data_filepath(cred_filename)
return cred_filepath.exists()
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ license = {file="LICENSE"}
dynamic = ["version"]

# Dependencies
requires-python = ">=3.11"
requires-python = ">=3.9"
dependencies = [
"requests>=2.31.0",
"requests-mock>=1.11.0",
"PyYAML>=6.0.1",
"click>=8.1.7",
"pandas>=2.2.2"
"pandas>=2.2.2",
"tqdm>=4.66.5"
]

authors = [
Expand Down

0 comments on commit 2b7c2c8

Please sign in to comment.