tabular_enhancement_tool.core module

class tabular_enhancement_tool.core.BaseEnhancer(max_workers=5, flatten_response=True, response_column_name='response')[source]

Bases: object

Base class for enhancing DataFrames asynchronously.

Parameters:
  • max_workers (int, default: 5)

  • flatten_response (bool, default: True)

  • response_column_name (str, default: 'response')

process_dataframe(df)[source]

Asynchronously processes each row of the DataFrame.

Parameters:

df (DataFrame)

Return type:

DataFrame

class tabular_enhancement_tool.core.TabularEnhancer(api_url=None, mapping=None, file_path=None, max_workers=5, auth=None, headers=None, method='POST', flatten_response=True, response_column_name='api_response')[source]

Bases: BaseEnhancer

Parameters:
  • api_url (str, default: None)

  • mapping (Dict[str, Any], default: None)

  • file_path (Union[str, Path], default: None)

  • max_workers (int, default: 5)

  • auth (Any, default: None)

  • headers (Dict[str, str], default: None)

  • method (str, default: 'POST')

  • flatten_response (bool, default: True)

  • response_column_name (str, default: 'api_response')

enhance()[source]

Enhances the loaded DataFrame using the configured API.

Return type:

DataFrame

process_dataframe(df)[source]

Asynchronously processes each row of the DataFrame.

Parameters:

df (DataFrame)

Return type:

DataFrame

read()[source]

Reads the tabular file and detects formatting (e.g., delimiter).

Return type:

DataFrame

save(suffix='_enhanced')[source]

Saves the DataFrame to the same format as the original file.

Parameters:

suffix (str, default: '_enhanced') – Suffix to append to the output filename.

Return type:

str