Creating static database in Telegraf in run time

Hi, I need to add some meta-data information the source of which is external file. I am using kafka consumer telegraf plugin, so for adding the metadata during run time, I am thinking to use execd plugin, where I would run a python script to get the tags and insert them in kafka data in run time. However, I am not able to get the tags using python script. Below are the files I am using:

  1. Python script -
import csv

def main():
    f = open("meta-data.csv",'r')
    csvfile = csv.reader(f)
    heading = next(csvfile)
    for lines in csvfile:

if __name__ == "__main__":
  1. Telegraf config:
  files = ["input_eg.json"]
  data_format = "json"
##other config provided

    command = ["/usr/bin/python3", ""]
    data_format = "influx"

Also, can somebody suggest would could be an alternative/better solution for this problem statement?