What is a JSON format

1 min readDataGetting Started
7-Day Challenge

Land Your First Data Science Job

A proven roadmap to prepare for $75K+ entry-level data roles. Perfect for Data Scientist ready to level up their career.

Build portfolios that hiring managers love
Master the Python and SQL essentials to be industry-ready
Practice with real interview questions from tech companies
Access to the $100k/y Data Scientist Cheatsheet

Join thousands of developers who transformed their careers through our challenge. Unsubscribe anytime.

JSON format is an industry standard.

It is a data format, mainly used to exchange data on the web.

Example:

  • Facebook.com when you request your profile
  • Youtube.com when you ask for new videos

A lot of services rely on JSON data format.

What does it look like ?

{
  "Address": "9611-9809 West Rosedale Road",
  "Longitude": -98.5259864,
  "Email": "[email protected]",
  "Created At": "2017-10-07T01:34:35.462",
  "Password": "ccca881f-3e4b-4e5c-8336-354103604af6",
  "Source": "Twitter",
  "ID": 1,
  "Zip": "68883",
  "Latitude": 40.71314890000001,
  "Birth Date": "1986-12-12",
  "City": "Wood River",
  "State": "NE",
  "Name": "Hudson Borer"
}

It works in a key:value format.

as so...

{
  "key": "value"
}

This format is easily readable in any programming language, but in Python it looks like this.

It can be read from a file :

import json # The built-in json library that we use to read json files

# We read the json file and assign its value to a Python dictionnary 
with open("path/to/file.json") as file:
	data = json.loads(file)

print(data)
A json file

Or from a Python string :

import json # The built-in json library that we use to read json files

my_json_string = '{
  "Address": "9611-9809 West Rosedale Road",
  "Email": "[email protected]"
}'

data = json.loads(my_json_string)

print(data)
Or a Python string
7-Day Challenge

Land Your First Data Science Job

A proven roadmap to prepare for $75K+ entry-level data roles. Perfect for Data Scientist ready to level up their career.

Build portfolios that hiring managers love
Master the Python and SQL essentials to be industry-ready
Practice with real interview questions from tech companies
Access to the $100k/y Data Scientist Cheatsheet

Join thousands of developers who transformed their careers through our challenge. Unsubscribe anytime.

Free Newsletter

Master Data Science in Days, Not Months 🚀

Skip the theoretical rabbit holes. Get practical data science skills delivered in bite-sized lessons – Approach used by real data scientist. Not bookworms. 📚

Weekly simple and practical lessons
Access to ready to use code examples
Skip the math, focus on results
Learn while drinking your coffee

By subscribing, you agree to receive our newsletter. You can unsubscribe at any time.