Package: boto-formatter
boto_formatterWhat is boto _formatter?boto_response_formatter is decorator that convert standard boto3 function response (returned as python list) in flattened JSON or tabular CSV formats for [list of supported services and functions] (https://github.com/awslabs/boto-formatter/blob/main/docs/supported_services.md). You can output the response to print, file or send flattened columnar JSON list to another function to continue your process.boto_formatter simplifies the process and reduce the need of writing custom codebase potentially of 100s of line of code to 4-5 lines of code for simple use cases like generating list of lambda functions or list of cloudfront distriubtions with all the attributes that AWS Python SDK provides.How it works?You simply add decorator to your python function (The function which is returning   list from boto3 function) and it will convert the boto3 return list to flatten JSON or comma separate values (CSV).By adding  decorator@boto_response_formatterto a function as example shown below in  list_policies_fmt() function the response of the function will be converted to .csv . Generated csv response will also be saved in a file iam_list_polices_.csv in a output folder located in the same directory of invoking python script.
You can also notice the difference in lines of code when using boto_formatter and without boto_formatter to achieve the same result of parsing and flattening the json response.import boto3
from  boto_formatter.core_formatter import boto_response_formatter

# With boto_formatter
@boto_response_formatter(service_name="iam", function_name="list_policies", format_type="csv", output_to="file" ,pagination="yes")
def list_policies_fmt():
    client = boto3.client('iam')
    paginator = client.get_paginator('list_policies')
    result = []
    for page in paginator.paginate():
        result.append(page)
    return result

# Without boto_formatter
def list_policies_without_boto_formatter():
	client = boto3.client('iam')
	paginator = client.get_paginator('list_policies')
	result = []
	for page in paginator.paginate():
		for role in page['Policies']:
			json_obj = {}
			json_obj['PolicyName'] = role['PolicyName']
			json_obj['PolicyId'] = role['PolicyId']
			json_obj['Arn'] = role['Arn']
			json_obj['Path']=str(role['Path'])
			json_obj['DefaultVersionId'] = str(role['DefaultVersionId'])
			json_obj['AttachmentCount'] = str(role['AttachmentCount'])
			json_obj['PermissionsBoundaryUsageCount'] = str(role['PermissionsBoundaryUsageCount'])
			json_obj['IsAttachable'] = str(role['IsAttachable'])
			if "Description" in role.keys():
				json_obj['Description'] = str(role['Description'])
			json_obj['CreateDate'] = str(role['CreateDate'])
			json_obj['UpdateDate'] = str(role['UpdateDate'])
			if "Tags" in role.keys():
				json_obj['Tags_Key'] = role['Tags']['Key']
				json_obj['Tags_Value'] = role['Tags']['Value']
			result.append(json_obj)


		return result

list_policies_fmt()
list_policies_without_boto_formatter()SetupFor Installation setup clickhereUsagePlease click on each function to see the usage/exampleClick on service to see the usageServiceFunctionsGeneral usageGeneral usageaccessanalyzer1.list_analyzers2.list_findingsapigateway3.get_rest_apisbudgets4.describe_budgetscloudfront5.list_distributions6.list_functionscloudtrail7.list_trailscloudwatch8.list_dashboards9.list_metricscodecommit10.list_repositoriesdynamodb11.list_tablesec212.describe_addresses13.describe_flow_logs14.describe_instances15.describe_network_acls16.describe_route_tables17.describe_security_groups18.describe_security_group_rules19.describe_snapshots20.describe_subnets21.describe_transit_gateways22.describe_volumes23.describe_vpcs24.describe_vpc_endpoints25.describe_vpc_peering_connections26.describe_vpn_connectionsecs27.list_clusters28.list_services29.list_tasksefs30.describe_file_systemseks31.describe_cluster32.list_clusters33.list_fargate_profileselasticache34.describe_cache_clusterselbv235.describe_load_balancersemr-serverless36.list_applications37.list_job_runsemr38.list_clusters39.list_instance_fleets40.list_notebook_executions41.list_studiosiam42.list_users43.list_access_keys44.list_account_aliases45.list_attached_group_policies46.list_attached_role_policies47.list_attached_user_policies48.list_group_policies49.list_groups50.list_policies51.list_roleskms52.list_keyslambda53.list_functions54.list_layersorganizations55.list_accounts56.list_policiesrds57.describe_db_clusters58.describe_db_instances59.describe_db_security_groups60.describe_db_snapshots61.describe_global_clustersredshift-serverless62.list_namespaces63.list_workgroupsredshift64.describe_clustersroute5365.list_cidr_blocks66.list_hosted_zones67.list_hosted_zones_by_vpc68.list_vpc_association_authorizationsroute53domains69.list_domains70.list_pricess371.create_bucket72.list_buckets73.list_multipart_uploads74.list_objects_v2sns75.list_subscriptions76.list_topicssqs77.list_queuesLicenseThis library is licensed under the MIT-0 License. See the LICENSE file.ConsiderationsWhen the format_type is selected as "csv" ;boto_formatter will skip the columns which contains "," in value.Majority of the cases Library returns formatted response of all the attributes that Python SDK provides. However, it doesn't assure 100 % coverage of all the attributes that Python SDK provides.Library is not designed for latency-based requirements. So, if you have high latency requirements, please evaluate library in lower enviornments (dev,QA) before using in high latency-based environment.