Consensus.utils module

Consensus.utils._server_selector()

Select the server based on the provided name.

Returns:

Dictionary of servers.

Return type:

Dict[str, Any]

Consensus.utils.get_server(key, **kwargs)

Helper function to get the server based on the provided name.

Parameters:
  • key (str) – Name of the server.

  • **kwargs (Dict[str, Any]) – Keyword arguments to pass to the server class.

Returns:

Instance of the server class.

Return type:

Any

Consensus.utils.get_server_name(server=None)

Get the name of the server.

Parameters:

server (str) – Name of the server.

Returns:

Name of the server.

Return type:

str

Consensus.utils.read_lookup(lookup_folder=None, server_name=None)

Read lookup table.

Parameters:
  • lookup_folder (Path) – pathlib.Path() to the folder where lookup.json file is currently saved.

  • server_name (str) – The name of the server. For EsriConnector() sub-classes, this is the same as self._name.

Returns:

Lookup table as a Pandas dataframe.

Return type:

pd.DataFrame

Consensus.utils.where_clause_maker(values, column)

Create a SQL where clause for Esri ArcGIS servers based on a list of values in a column and that column’s name. You must also include the layer’s name.

Parameters:
  • values (List) – A list of values in column to include in the where clause.

  • column (str) – The column name to use in the where clause.

Returns:

A SQL where clause.

Return type:

str