MCPcopy Create free account
hub / github.com/IQEngine/IQEngine / get

Function get

api/database/metadata_repo.py:24–55  ·  view source on GitHub ↗

Get a metadata by account, container and filepath Parameters ---------- account : str The account name. container : str The container name. filepath : str The filepath Returns ------- Metadata The Sigmf metadata.

(account, container, filepath, access_allowed=Depends(check_access))

Source from the content-addressed store, hash-verified

22
23
24async def get(account, container, filepath, access_allowed=Depends(check_access)) -> Metadata | None:
25 """
26 Get a metadata by account, container and filepath
27
28 Parameters
29 ----------
30 account : str
31 The account name.
32 container : str
33 The container name.
34 filepath : str
35 The filepath
36
37 Returns
38 -------
39 Metadata
40 The Sigmf metadata.
41 """
42 if access_allowed is None:
43 return None
44
45 metadata_collection: AgnosticCollection = collection()
46 metadata = await metadata_collection.find_one(
47 {
48 "global.traceability:origin.account": account,
49 "global.traceability:origin.container": container,
50 "global.traceability:origin.file_path": filepath,
51 }
52 )
53 if not metadata:
54 return None
55 return Metadata(**metadata)
56
57
58async def exists(account, container, filepath, access_allowed=Depends(check_access)) -> bool:

Callers

nothing calls this directly

Calls 2

MetadataClass · 0.90
collectionFunction · 0.70

Tested by

no test coverage detected