compass.scripts.download.download_jurisdiction_ordinance_from_search_results#

async download_jurisdiction_ordinance_from_search_results(jurisdiction, known_search_results, file_loader_kwargs=None, browser_semaphore=None, se_shard_out_dir=None, **kwargs)[source]#

Download the ordinance document(s) for a single jurisdiction

Parameters:
  • jurisdiction (Jurisdiction) – Location objects representing the jurisdiction.

  • known_search_results (dict) – Pre-run search results to download without querying search engines or reapplying URL filters and top-N.

  • file_loader_kwargs (dict, optional) – Dictionary of keyword-argument pairs to initialize elm.web.file_loader.AsyncWebFileLoader with. If found, the “pw_launch_kwargs” key in these will also be used to initialize the elm.web.search.google.PlaywrightGoogleLinkSearch used for the google URL search. By default, None.

  • browser_semaphore (asyncio.Semaphore, optional) – Semaphore instance that can be used to limit the number of playwright browsers used to download content from the web open concurrently. If None, no limits are applied. By default, None.

  • se_shard_out_dir (path-like, optional) – Directory where search engine shard results should be written. If None, the results will not be written to disk. By default, None.

  • **kwargs – Additional keyword arguments forwarded to elm.web.search.run.web_search_links_as_docs(). Common entries include usage_tracker for logging LLM usage and extra Playwright configuration.

Returns:

list or None – List of BaseDocument instances possibly containing ordinance information, or None if no ordinance document was found.

Notes

Requires TempFileCachePB service to be running.