Skip to content

priyolahiri/flattenJSON

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flattenJSON

Takes a file containing JSON and flattens it. For example, given an input file like:

{
  "a": 1,
  "b": true,
  "c": {
    "d": 3,
    "e": "test"
  }
}

the output is:

{
  "a": 1, 
  "b": true, 
  "c.d": 3, 
  "c.e": "test"
}

It also has support for multiple levels of hierarchical dictionary-like structures. There is no support for list structures, and the program will exit if it encounters it.

usage

cat files/input.json | python main.py

test

python tests.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages