MCPcopy Create free account
hub / github.com/alephdata/aleph / export

Function export

aleph/views/xref_api.py:102–132  ·  view source on GitHub ↗

--- post: summary: Download cross-reference results description: Download results of cross-referencing as an Excel file parameters: - in: path name: collection_id required: true schema: type: integer responses: '202':

(collection_id)

Source from the content-addressed store, hash-verified

100
101@blueprint.route("/api/2/collections/<int:collection_id>/xref.xlsx", methods=["POST"])
102def export(collection_id):
103 """
104 ---
105 post:
106 summary: Download cross-reference results
107 description: Download results of cross-referencing as an Excel file
108 parameters:
109 - in: path
110 name: collection_id
111 required: true
112 schema:
113 type: integer
114 responses:
115 '202':
116 description: Accepted
117 tags:
118 - Xref
119 - Collection
120 """
121 collection = get_db_collection(collection_id, request.authz.READ)
122 label = "%s - Crossreference results" % collection.label
123 export = create_export(
124 operation=SETTINGS.STAGE_EXPORT_XREF,
125 role_id=request.authz.id,
126 label=label,
127 collection=collection,
128 mime_type=XLSX,
129 )
130 job_id = get_session_id()
131 queue_task(None, SETTINGS.STAGE_EXPORT_XREF, job_id=job_id, export_id=export.id)
132 return ("", 202)

Callers

nothing calls this directly

Calls 4

get_db_collectionFunction · 0.90
create_exportFunction · 0.90
get_session_idFunction · 0.90
queue_taskFunction · 0.90

Tested by

no test coverage detected