Reference#

pydataassist#

This is module to support encryption.

pydataassist.encryption.decrypt_data(encrypted_data)#

Decrypts base64-encoded data using AES.MODE_CBC.

Parameters:

encrypted_data (str) – The base64-encoded encrypted data.

Returns:

The decrypted data as a bytes object.

Return type:

str

pydataassist.encryption.encrypt_data(data)#

Encrypts data using AES.MODE_CBC.

Parameters:

data (str) – The data to be encrypted as a bytes object.

Returns:

The encrypted data as a base64-encoded string.

Return type:

str

This is module to support encryption.

pydataassist.restassist.api_to_df(api_url, method='GET', headers=None, data=None, response_format='json')#

_summary_.

Parameters:
  • api_url (str) – _description_

  • method (str) – _description_. Defaults to “GET”.

  • headers (dict[str, Any], optional) – _description_. Defaults to {}.

  • data (str) – _description_. Defaults to “”.

  • response_format (str) – _description_. Defaults to “json”.

Raises:

ValueError – _description_

Returns:

_description_

Return type:

DataFrame

pydataassist.restassist.call_api(api_url, method='GET', headers=None, data=None, response_format='json')#

Call an API and return the response as a dictionary.

Parameters:
  • api_url (str) – _description_

  • method (str) – _description_. Defaults to “GET”.

  • headers (dict[str, Any], optional) – _description_. Defaults to {}.

  • data (str) – _description_. Defaults to “”.

  • response_format (str) – _description_. Defaults to “json”.

Raises:

ValueError – _description_

Returns:

_description_

Return type:

Any

This is module to support encryption.

pydataassist.sparkassist.get_element_type(list_obj)#

_summary_.

Parameters:

list_obj (Any) – _description_

Returns:

_description_

Return type:

Any

pydataassist.sparkassist.get_spark_df_from_json(json_data)#

_summary_.

Parameters:

json_data (str) – _description_

Returns:

_description_

Return type:

DataFrame

pydataassist.sparkassist.get_spark_schema_from_json_response(json_response)#

Extract the schema from a JSON response and return it as a Spark StructType.

Parameters:

json_response (str) – The JSON response from which to extract the schema.

Returns:

A Spark StructType representing the schema of the JSON data.

Return type:

StructType