Skip to content

Commit 110b200

Browse files
committed
updated README.md
1 parent 21465f2 commit 110b200

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
# About jsonvice
77

8-
jsonvice is small command line tool (cli) for minifying JSON but with optimal precision truncation/rounding. In many applications floating point values in JSON can be very long (15 digits) but this level of accuracy isn't needed and takes up much space.
8+
jsonvice is command line tool for minifying JSON with optimal precision truncation/rounding. In many applications floating point values in JSON can be very long (15 digits or more) but this level of accuracy isn't needed and takes up much space.
99

10-
jsonvice allows the truncation of all the embedded floating point numbers to a specified number of digits.
10+
jsonvice allows the truncation of all the embedded floating point numbers (wherever they appear) to a specified number of digits.
1111

12-
It also removes unencessary white space to help minify JSON files. However there are many tools that can minify JSON.
12+
It also removes unnecessary white space to minify JSON files.
1313

14-
input.json
14+
sample_input.json
1515
```json
1616
{
1717
"x" : 12.32,
@@ -21,7 +21,7 @@ input.json
2121
}
2222
```
2323

24-
run jsonvice
24+
now run jsonvice
2525
```sh
2626
jsonvice -i input.json -o output.json -p 4
2727
```
@@ -36,7 +36,7 @@ ouput.json
3636

3737
compactify json and reduce floating point precision to max of 5 digits by rounding
3838
```shell
39-
jsonvice -i myfile.json -o output.json -p 5
39+
jsonvice -i sample_input.json -o output.json -p 5
4040
```
4141

4242
compactify json and reduce floating point precision to max of 5 digits by rounding down
@@ -76,7 +76,7 @@ poetry run jsonvice -i inputfile.json -o outputfile.json -p 4
7676

7777

7878
# Installing as stand alone commandline tool
79-
pipx can be used to install an isolated version of jsonvice as a command line tool.
79+
pipx can be used to install a stand alone version of jsonvice as a command line tool. (note pipx is like pip or pip3 but installs programs with their own virtual environment.)
8080

8181
```sh
8282
pipx install jsonvice
@@ -95,21 +95,25 @@ jsonvice -i inputfile.json -o - -b
9595
```
9696

9797
## Python version support
98-
Python version 3.6 or higher is required to build
98+
Python version 3.6 or higher is required to build jsonvice. If pipx is used for install isolation takes place automatically.
9999

100100
# Testing
101-
poetry run pytest
101+
Both pytest and tox were used to build jsonvice. Testing can be performed at the command line via either tool:
102102

103+
```sh
104+
poetry run pytest
105+
```
103106
or
104-
107+
```sh
105108
tox
109+
```
106110

107111
# History & Motivation
108112
json vice started as a script to compactify / minify some large machine learning model files which had large floating point numbers. By rounding to fixed number of sig digits and then testing the models against testsuites to see the effects of truncation.
109113

110114
At the time couldn't find a tool and whipped up small script (the original script is in /dev directory).
111115

112-
So jsonvice was built to learn / test practices around the python poetry and pipx tools, for use in other projects, but starting with a small example cli program that already worked.
116+
So jsonvice was built to learn / test practices around the python poetry and pipx tools, for use in other projects, but starting with a small example cli program that already worked.
113117

114118
# License
115119
jsonvice uses the BSD-2 open source license

0 commit comments

Comments
 (0)