MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / sampleload

Function sampleload

openlibrary/plugins/openlibrary/code.py:235–240  ·  view source on GitHub ↗
(filename="sampledump.txt.gz")

Source from the content-addressed store, hash-verified

233
234@infogami.action
235def sampleload(filename="sampledump.txt.gz"):
236
237 with gzip.open(filename) if filename.endswith(".gz") else open(filename) as file:
238 queries = [json.loads(line) for line in file]
239
240 print(web.ctx.site.save_many(queries, action="infogami-sampleload-action"))
241
242
243class routes(delegate.page):

Callers

nothing calls this directly

Calls 2

loadsMethod · 0.80
save_manyMethod · 0.45

Tested by

no test coverage detected