-3

Apologies if this comes on as a noob question as I totally am or a duplicate.

I have a file on a webserver that I need to parse. the location of the file is /var/www/html called test.json.

I want to parse it with a python script and return a version

{
"commit_id": "d44f19c",
"environment": "test",
"package_build_date": "15/05/2015",
"project": "devopstest",
"tags_at_commit": [
"v1.6.0-rc.1"
],
"version": "v1.6.0-rc.1"
}

Any help/guidance appreciated

Magisch
  • 7,312
  • 9
  • 36
  • 52
moh_abk
  • 2,064
  • 7
  • 36
  • 65

1 Answers1

0

Just use import json:

import json

with open('file.json', 'r') as f:
    json_data = json.load(f)
JRazor
  • 2,707
  • 18
  • 27