Skip to content

Placerstores

flowtask.components.PlacerStores

PlacerStores

PlacerStores(loop=None, job=None, stat=None, **kwargs)

Bases: DBSupport, tPandas

PlacerStores.

Overview

The PlacerStores is used to match PlacerAI stores with Stores tables at different schemas.

Properties

.. table:: Properties :widths: auto

+------------------+----------+-----------+-----------------------------------------------------------------------------------+ | Name | Required | Type | Description | +------------------+----------+-----------+-----------------------------------------------------------------------------------+ | location_field | Yes | str | The name of the column to be used for matching. | +------------------+----------+-----------+-----------------------------------------------------------------------------------+

Return A New Dataframe with all stores matching using a Fuzzy Search Match.

find_best_match

find_best_match(address, choices, threshold=80, token_threshold=80)

Find the best fuzzy match for a given address.

Parameters: - address (str): The address to match. - choices (list): List of addresses to match against. - threshold (int): Minimum similarity score to consider a match.

Returns: - best_match (str) or None: The best matching address or None if no match meets the threshold. - score (int): The similarity score of the best match.

preprocess_address

preprocess_address(address)

Preprocess Address for Fuzzy String Matching.

Example:

PlacerStores:
  location_field: find_address