Skip to content

Dynamic

anandam1992 edited this page May 21, 2018 · 1 revision

We used simple Python-based code to parse the data out of the data source. This helped us to use Python-based libraries like Request in our code. Using the same we were also free to store the data in the required format i.e., the xls/json/csv formats to store the data and further post the data to the platform used (DNIF).

Python Commands: Libraries Used-

  1. Schedule
  2. Time
  3. BeautifulSoup4 (bs4)
  4. Request
  5. Urlopen
  6. Csv
  7. Json

image

Code Explanation

The code uses simple Request Library functions to POST the data from the updated JSON file to the URL of the DNIF datastore location.

   headers = {'content-type': 'application/json'}
   url = 'http://192.168.0.104:9234/json/receive'
   data=json.dumps(out)
   requests.post(url, out)
   r=requests.post(url, out) 


Clone this wiki locally