<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Guisell Urbina</title>
    <description>The latest articles on DEV Community by Guisell Urbina (@guisell_urbina_74e3c24732).</description>
    <link>https://dev.to/guisell_urbina_74e3c24732</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3207958%2F9e1f0b84-5b45-44b8-997e-7624a23643f5.jpg</url>
      <title>DEV Community: Guisell Urbina</title>
      <link>https://dev.to/guisell_urbina_74e3c24732</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/guisell_urbina_74e3c24732"/>
    <language>en</language>
    <item>
      <title>How to Run Data Exchange?</title>
      <dc:creator>Guisell Urbina</dc:creator>
      <pubDate>Mon, 26 May 2025 02:41:58 +0000</pubDate>
      <link>https://dev.to/guisell_urbina_74e3c24732/how-to-run-data-exchange-2b1h</link>
      <guid>https://dev.to/guisell_urbina_74e3c24732/how-to-run-data-exchange-2b1h</guid>
      <description>&lt;p&gt;Understanding the journey of data is very useful. One common way to exchange information is through JSON files, a lightweight format widely used, for example, in NoSQL databases like MongoDB.&lt;/p&gt;

&lt;p&gt;In Python, there are some important functions to work with JSON data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;json.dump(obj, file)&lt;/code&gt;: Saves a Python object &lt;code&gt;obj&lt;/code&gt; to a &lt;code&gt;.json&lt;/code&gt; file.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;json.dumps(obj)&lt;/code&gt;: Converts a Python object &lt;code&gt;obj&lt;/code&gt; into a JSON string (without creating a file).
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;json.load(file)&lt;/code&gt;: Reads a &lt;code&gt;.json&lt;/code&gt; file and converts its contents into a Python object.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;json.loads(string)&lt;/code&gt;: Converts a JSON string into a Python object.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;`python&lt;br&gt;
import json&lt;/p&gt;

&lt;h1&gt;
  
  
  Saving Python dict to JSON file
&lt;/h1&gt;

&lt;p&gt;data = {"name": "Guisell", "role": "backend learner"}&lt;br&gt;
with open("data.json", "w") as f:&lt;br&gt;
    json.dump(data, f)&lt;/p&gt;

&lt;h1&gt;
  
  
  Converting Python dict to JSON string
&lt;/h1&gt;

&lt;p&gt;json_str = json.dumps(data)&lt;br&gt;
print(json_str)&lt;/p&gt;

&lt;h1&gt;
  
  
  Loading JSON file back to Python dict
&lt;/h1&gt;

&lt;p&gt;with open("data.json", "r") as f:&lt;br&gt;
    loaded_data = json.load(f)&lt;br&gt;
print(loaded_data)&lt;/p&gt;

&lt;h1&gt;
  
  
  Converting JSON string back to Python dict
&lt;/h1&gt;

&lt;p&gt;parsed_data = json.loads(json_str)&lt;br&gt;
print(parsed_data)`&lt;/p&gt;

&lt;p&gt;JSON is an essential format for data exchange, especially when working with APIs and databases. Knowing these functions helps you efficiently read and write JSON data in Python.&lt;/p&gt;

&lt;p&gt;Have you worked with JSON files or developed an API before? Share your experiences or questions in the comments!&lt;/p&gt;

</description>
      <category>python</category>
      <category>json</category>
      <category>backend</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
