Skip to content

Write method wanted for JsonPreprocessor #150

@HolQue

Description

@HolQue

The JsonPreprocessor can be used to read content from JSON files with:

jsonLoad(file)

A user might have the need to write back data to a JSON file (e.g. after the content has been modified). But this has to be done manually with something like

with open(outfile,"w", encoding='utf-8') as jsonfile:
   json.dump(new_content,jsonfile,ensure_ascii=False)
   jsonfile.close()

This is because of a corresponding method is missing in JsonPreprocessor. Long winded. Why not using the already existing JsonPreprocessor object in Python code?

Therefore wanted is the possibility to do this:

jsonWrite(new_content,jsonfile)

or maybe

jsonDump(new_content,jsonfile)

to be more aligned with the original function name.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions