MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / get_document

Method get_document

src/bcf/bcf/v3/bcfapi.py:545–555  ·  view source on GitHub ↗
(self, project_id: str = "", topic_id: str = "", document_id: str = "")

Source from the content-addressed store, hash-verified

543 return response.status_code
544
545 def get_document(self, project_id: str = "", topic_id: str = "", document_id: str = "") -> tuple[int, str]:
546 headers = {
547 "Authorization": f"Bearer {self.foundation_client.get_access_token()}",
548 "Content-type": "application/octet-stream",
549 }
550
551 response = requests.get(f"{self.baseurl}/projects/{project_id}/topics/documents/{document_id}", headers=headers)
552 content = response.content.decode("utf-8")
553 with open(os.path.join(self.filepath, f"{project_id}_{topic_id}_{document_id}_document.txt"), "w") as f:
554 f.write(content)
555 return response.status_code, content
556
557 def get_topics_events(self, project_id: str = "") -> list[Any]:
558 return self.get(

Callers

nothing calls this directly

Calls 6

openFunction · 0.50
get_access_tokenMethod · 0.45
getMethod · 0.45
decodeMethod · 0.45
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected