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

Function get_current_batch

scripts/affiliate_server.py:331–339  ·  view source on GitHub ↗

At startup, get the `name` (e.g. amz) openlibrary.core.imports.Batch() for global use.

(name: str)

Source from the content-addressed store, hash-verified

329
330
331def get_current_batch(name: str) -> Batch:
332 """
333 At startup, get the `name` (e.g. amz) openlibrary.core.imports.Batch() for global use.
334 """
335 global batch
336 if not batch:
337 batch = Batch.find(name) or Batch.new(name)
338 assert batch
339 return batch
340
341
342def get_isbns_from_book(book: dict) -> list[str]: # Singular: book

Callers 2

stage_from_google_booksFunction · 0.85
process_amazon_batchFunction · 0.85

Calls 2

findMethod · 0.45
newMethod · 0.45

Tested by

no test coverage detected