elm.ords.process.process_county

async process_county(county, text_splitter, num_urls=5, file_loader_kwargs=None, browser_semaphore=None, **kwargs)[source]

Download and parse ordinance document for a single county.

Parameters:
  • county (elm.ords.utilities.location.Location) – County to retrieve ordinance document for.

  • text_splitter (obj, optional) – Instance of an object that implements a split_text method. The method should take text as input (str) and return a list of text chunks. Langchain’s text splitters should work for this input.

  • num_urls (int, optional) – Number of unique Google search result URL’s to check for ordinance document. By default, 5.

  • file_loader_kwargs (dict, optional) – Dictionary of keyword-argument pairs to initialize elm.web.file_loader.AsyncFileLoader with. The “pw_launch_kwargs” key in these will also be used to initialize the elm.web.google_search.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 open concurrently. If None, no limits are applied. By default, None.

  • **kwargs – Keyword-value pairs used to initialize an elm.ords.llm.LLMCaller instance.

Returns:

elm.web.document.BaseDocument | None – Document instance for the ordinance document, or None if no document was found. Extracted ordinance information is stored in the document’s metadata attribute.