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

Method get_snippet

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

Source from the content-addressed store, hash-verified

285 return self.delete(f"/projects/{project_id}/topics/{topic_id}")
286
287 def get_snippet(self, project_id: str = "", topic_id: str = "") -> tuple[int, str]:
288 headers = {
289 "Authorization": f"Bearer {self.foundation_client.get_access_token()}",
290 "Content-type": "application/octet-stream",
291 }
292
293 response = requests.get(f"{self.baseurl}/projects/{project_id}/topics/{topic_id}/snippet", headers=headers)
294 content = response.content.decode("utf-8")
295 with open(os.path.join(self.filepath, f"{project_id}_{topic_id}_snippet.txt"), "w") as f:
296 f.write(content)
297 return response.status_code, content
298
299 def update_snippet(self, project_id: str = "", topic_id: str = "", files: Any = None, data: Any = None) -> int:
300 headers = {

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