'Modifying request body according to inputs read from a csv file

I have to read the CSV file from the AWS S3 bucket, say it has 5 columns. Column 1,Column 2,...,Column 5. I have fetched the column names using the below code.

column_names=[]
client = boto3.client('s3',
                    aws_access_key_id = access_key,
                    aws_secret_access_key = secret_access_key)
csv_from_aws_s3 = path 
df = pd.read_csv(path)
for col in df.columns:
    column_names.append(col)
print(column_names)

Some column details are static, and some are dynamic.

Say (eg Designation)Column1= static & (eg Salary)column2 dynamic.

Specified by user input, taken by any UI Text Editor. Now I have to make API calls to GET and POST static & dynamic part from the CSV files and store it in an SQL database.

I am using django-rest-api.

With some research, I came across Requests lib that is suitable for this problem.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source