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

Function statistics

aleph/views/base_api.py:138–161  ·  view source on GitHub ↗

Get a summary of the data acessible to an anonymous user. Changed [3.9]: Previously, this would return user-specific stats. --- get: summary: System-wide user statistics. description: > Get a summary of the data acessible to an anonymous user. responses:

()

Source from the content-addressed store, hash-verified

136
137@blueprint.route("/api/2/statistics")
138def statistics():
139 """Get a summary of the data acessible to an anonymous user.
140
141 Changed [3.9]: Previously, this would return user-specific stats.
142 ---
143 get:
144 summary: System-wide user statistics.
145 description: >
146 Get a summary of the data acessible to an anonymous user.
147 responses:
148 '200':
149 description: OK
150 content:
151 application/json:
152 schema:
153 type: object
154 tags:
155 - System
156 """
157 enable_cache(vary_user=False)
158 key = cache.key(cache.STATISTICS)
159 data = {"countries": [], "schemata": [], "categories": []}
160 data = cache.get_complex(key) or data
161 return jsonify(data)
162
163
164@blueprint.route("/api/2/sitemap.xml")

Callers

nothing calls this directly

Calls 4

enable_cacheFunction · 0.90
jsonifyFunction · 0.90
keyMethod · 0.80
get_complexMethod · 0.80

Tested by

no test coverage detected