QuickSnip LogoA light blue logo with a thunderbolt in bracketsQuickSnip

Read JSON File

Reads a JSON file and parses its content.

  • json
  • file
  • read

Code

import json

def read_json(filepath):
    with open(filepath, 'r') as file:
        return json.load(file)

Usage

read_json('data.json') # Returns: Content of file as dict