title: how to update a json file in python
body: <p>im a beginner in python, i would like to know how to update a json file in python by adding another attribute named cat which is a specific category like sport,education,music...ect</p>
  <p>any help would be appreciated thank you</p>
  <p>here's an example of my json file data:</p>
  <p>before :</p>
  <pre><code>{&quot;tweet_id&quot;:&quot;1261276320878788609&quot;,
  &quot;date&quot;:&quot;Fri May 15 12:44:42 +0000 2020&quot;,
  &quot;raw_text&quot;:&quot;برنامج وطني لدعم المبدعين في مواجهة #كورونا&quot;,
  &quot;geo_source&quot;:&quot;user_location&quot;,
  &quot;location&quot;:{&quot;address&quot;:
  {&quot;country&quot;:&quot;Tunisia&quot;,&quot;country_code&quot;:&quot;tn&quot;,&quot;state_district&quot;:&quot;غزالة&quot;,&quot;county&quot;:&quot;العرب&quot;,&quot;state&quot;:&quot;Bizerte&quot;},
  &quot;response&quot;:
  &quot;{'place_id': 235309103, 'licence': 'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright', 'osm_type': 'relation', 'osm_id': 7124228, 'boundingbox': ['37.105957', '37.2033466', '9.4739053', '9.6124953'], 'lat': '37.1551868', 'lon': '9.54834183807249', 'display_name': 'العرب, غزالة, Bizerte, Tunisia', 'class': 'boundary', 'type': 'administrative', 'importance': 0.45, 'icon': '/data/nominatimimages/mapicons/poi_boundary_administrative.p.20.png','address':{'county': 'العرب', 'state_district': 'غزالة', 'state': 'Bizerte', 'country': 'Tunisia', 'country_code': 'tn'}}&quot;,
  &quot;geohash&quot;:&quot;snwg37buskzd&quot;,&quot;query_term&quot;:&quot;arab&quot;,&quot;lon&quot;:9.54834183807249,&quot;lat&quot;:37.1551868},
  &quot;user_friends_count&quot;:61,&quot;user_description&quot;:&quot;I love UAE and his great leadership&quot;,
  &quot;user_created_at&quot;:&quot;Wed Oct 09 11:41:41 +0000 2013&quot;,
  &quot;user_screen_name&quot;:&quot;SikandarMirani&quot;,
  &quot;user_id_str&quot;:&quot;706377881&quot;,
  &quot;user_verified&quot;:false,
  &quot;user_statuses_count&quot;:50804,
  &quot;user_followers_count&quot;:946,
  &quot;user_location&quot;:&quot;Dubai United Arab Emirates&quot;}
  </code></pre>
  <p>after :</p>
  <pre><code>{&quot;tweet_id&quot;:&quot;1261276320878788609&quot;,
  &quot;date&quot;:&quot;Fri May 15 12:44:42 +0000 2020&quot;,
  &quot;raw_text&quot;:&quot;برنامج وطني لدعم المبدعين في مواجهة ##البيان_القارئ_دائما&quot;,
  &quot;geo_source&quot;:&quot;user_location&quot;,
  &quot;location&quot;:{&quot;address&quot;:
  {&quot;country&quot;:&quot;Tunisia&quot;,&quot;country_code&quot;:&quot;tn&quot;,&quot;state_district&quot;:&quot;غزالة&quot;,&quot;county&quot;:&quot;العرب&quot;,&quot;state&quot;:&quot;Bizerte&quot;},
  &quot;response&quot;:
  &quot;{'place_id': 235309103, 'licence': 'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright', 'osm_type': 'relation', 'osm_id': 7124228, 'boundingbox': ['37.105957', '37.2033466', '9.4739053', '9.6124953'], 'lat': '37.1551868', 'lon': '9.54834183807249', 'display_name': 'العرب, غزالة, Bizerte, Tunisia', 'class': 'boundary', 'type': 'administrative', 'importance': 0.45, 'icon': '/data/nominatimimages/mapicons/poi_boundary_administrative.p.20.png','address':{'county': 'العرب', 'state_district': 'غزالة', 'state': 'Bizerte', 'country': 'Tunisia', 'country_code': 'tn'}}&quot;,
  &quot;geohash&quot;:&quot;snwg37buskzd&quot;,&quot;query_term&quot;:&quot;arab&quot;,&quot;lon&quot;:9.54834183807249,&quot;lat&quot;:37.1551868},
  &quot;user_friends_count&quot;:61,&quot;user_description&quot;:&quot;I love UAE and his great leadership&quot;,
  &quot;user_created_at&quot;:&quot;Wed Oct 09 11:41:41 +0000 2013&quot;,
  &quot;user_screen_name&quot;:&quot;SikandarMirani&quot;,
  &quot;user_id_str&quot;:&quot;706377881&quot;,
  &quot;user_verified&quot;:false,
  &quot;user_statuses_count&quot;:50804,
  &quot;user_followers_count&quot;:946,
  &quot;user_location&quot;:&quot;Dubai United Arab Emirates&quot;
  &quot;cat&quot;:&quot;(any category)&quot;}
  </code></pre>