Skip to content

rafael-c-alexandre/json-flattener-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Json Flattener

Overview

This JSON Flattener transforms a potentially branched and deep JSON structure object into a flattened one.

Getting Started

Prerequisites

  • Python3
  • Pytest

Open a terminal and Git clone this repository to your machine

https://github.com/99rafa/JsonFlattener

Running

Open a terminal in the JsonFlattener directory and run, for example

cat /path/to/jsonfile | python3 JsonFlattener.py

where /path/to/jsonfile is the path of the .json file that contains the JSON object.

A prompt will appear

Check the file 'out.json' to get the flattened JSON version.

The out.json file is where the flattened JSON object is stored.

To run the tests, run

pytest JsonFlattener.py

which will run the 3 unit tests produced, each one of them with one of the input files included in the example folder.

Observations

Challenge Duration: 2 hours

Done by: Rafael Alexandre

About

Challenge for MongoDB internship application process

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages