Assignment for job application
Backend Developer

Write a Python program which flattens JSON input as follows:

  • Filename of JSON – file should be passed to the program on the command line
  • The JSON input can be any valid JSON
  • The output of the program should be a flattened version of the JSON input

The input could look like this:

{
"format": "long",
"type": "objects",
"offset": 0,
"limit": 10,
"facets": {},
"objecttypes": [
"objects"
],
"language": "de-DE",
"count": 2,
"took": 165,
"objects": [
{
"_acl": [
{
"_id": 1335359,
"date_created": "2016-08-22T19:26:10 +02:00”,
“who”: {

}

Output should look like this:

data.format = "long"
data.type = "objects"
data.objects[0]._acl[0]._id = 1335359
data.objects[0]._acl[0].date_created = "2016..."

  • So the output has only one level of key = value pairs
  • If you like you can add an option for HTMLized output

Please create a public repository (eg github.com) and send us the link with your CV to jobs@ programmfabrik .de .