Skip to content

pushshift/JSON-Flatten

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

This Python script will flatten a nested JSON object (or Python dict).

If you run it directly, it will load an example Youtube object and flatten the keys.

You can also pipe a JSON object into it and get the flattened keys that way.

There are two parameters that can be used to modify the behavior of the flatten method.

The "sep" parameter is the separation character used between each key and child key. This defaults to ".".

The "include_values" parameter is a boolean and if set to True will also include the values of each of the flattened keys.

About

This code shows how to flatten nested keys which can help convert a nest JSON object into CSV, etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages