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 initializeelm.web.file_loader.AsyncWebFileLoaderwith. If found, the “pw_launch_kwargs” key in these will also be used to initialize theelm.web.search.google.PlaywrightGoogleLinkSearchused 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. IfNone, 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 includeusage_trackerfor logging LLM usage and extra Playwright configuration.
- Returns:
listorNone– List of BaseDocument instances possibly containing ordinance information, orNoneif no ordinance document was found.
Notes
Requires
TempFileCachePBservice to be running.