From 73d2854d792b05672dcdf3a0a86f6b45579c96de Mon Sep 17 00:00:00 2001 From: Kushal0217 <93171382+Kushal0217@users.noreply.github.com> Date: Sun, 1 Oct 2023 20:15:20 -0400 Subject: [PATCH] creating an example of functionality in the README>=.md The specific functionality that I used to be an example in this README was functionality to write and read in JSON. --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index bc4e199..ca03180 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,19 @@ pip install -U 'git+https://github.com/facebookresearch/fvcore' git clone https://github.com/facebookresearch/fvcore pip install -e fvcore ``` +## Example of usage +Some utilites provided by the fvcore repository is the ability to write and read in JSON. +``` +from fvcore.common.file_io import PathManager + +data = {"key": "value"} + +# Write to a JSON file +PathManager.write_json("data.json", data) + +# Read from a JSON file +loaded_data = PathManager.read_json("data.json") +``` ## License