We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6a89bc9 commit 5eb63b6Copy full SHA for 5eb63b6
1 file changed
pyenzyme/suite.py
@@ -45,6 +45,23 @@ def get_current(self) -> EnzymeMLDocument:
45
46
return EnzymeMLHandler.read_enzymeml_from_string(content)
47
48
+ def get_document(self, id: str) -> EnzymeMLDocument:
49
+ """
50
+ Retrieves an EnzymeML document from the service.
51
52
+ try:
53
+ response = self.client.get(f"/docs/{id}")
54
+ except httpx.ConnectError:
55
+ raise ConnectionError(
56
+ "Could not connect to the EnzymeML suite. Make sure it is running."
57
+ )
58
+
59
+ response.raise_for_status()
60
61
+ content = response.json()["data"]["content"]
62
63
+ return EnzymeMLHandler.read_enzymeml_from_string(content)
64
65
def update_current(self, doc: EnzymeMLDocument):
66
"""
67
Updates the current EnzymeML document on the service.
0 commit comments