You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+51-20Lines changed: 51 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Using **lzhw_cli** script and [pyinstaller](https://www.pyinstaller.org/), We ge
10
10
11
11
**The tool allows to compress and decompress files from and to any form, csv, excel etc without any dependencies or installations.**
12
12
13
-
**The tool works in parallel and most of its code is compiled to C code, so it is pretty fast**. Next page in the documentation there is a comparison in performance with other tools.
13
+
**The tool can work in parallel and most of its code is written in Cython, so it is pretty fast**. Next page in the documentation there is a comparison in performance with other tools.
14
14
15
15
The tool now works perfectly on Windows for now, both Linux and Mac versions are being developed soon.
LZHW is a tabular data compression tool. It is used to compress excel, csv and
29
-
any flat file. Version: 0.0.9
29
+
any flat file. Version: 0.0.10
30
30
31
31
optional arguments:
32
32
-h, --help show this help message and exit
@@ -40,6 +40,8 @@ optional arguments:
40
40
to compress or decompress
41
41
-r ROWS, --rows ROWS selectspecific rows to decompress (1-based)
42
42
-nh, --no-header skip header / data to be compressed has no header
43
+
-p, --parallel compress or decompress in parallel
44
+
-j JOBS, --jobs JOBS Number of CPUs to use if parallel (default all but 2)
43
45
```
44
46
As we can see, the tool takes an input file **"-f"**, and output **"-o"** where it should put the result whether it is compression or decompression based on the optional **"-d"** argument which selects decompression.
45
47
@@ -50,14 +52,16 @@ The **"-nh"**, --no-header, argument to specify if the data has no header.
50
52
51
53
The **"-r"**, --rows, argument is to specify number of rows to decompress, incase we don't need to decompress all rows.
52
54
55
+
The **"-p"**, --parallel, argument is to make compression and decompression goes in parallel to speed it up. And specifying the **"-j"**, --jobs, argument to determine the number of the CPUs to be used, in default it is all CPUs minus 2.
56
+
53
57
#### Compress
54
58
How to compress:
55
59
56
60
The tool can be used through command line.
57
61
For those who are new to command line, the easiest way to start it is to put the **lzhw.exe** tool in the same folder with the sheet you want to compress.
58
62
Then go to the folder's directory at the top where you see the directory path and one click thentype**cmd**, black command line will open to you where you can type the examples below.
59
63
60
-
64
+
*Using german_credit data from UCI Machine Learning Repository [1]*
61
65
```bash
62
66
lzhw -f "german_credit.xlsx" -o "gc_comp.txt"
63
67
```
@@ -75,17 +79,23 @@ time taken: 0.06792410214742024 minutes
75
79
Compressed Successfully
76
80
```
77
81
78
-
**N.B. This error message can appear while compressing or decompressing**
lzhw.exe: error: the following arguments are required: -f/--input, -o/--output
84
+
lzhw -f "german_credit.xlsx" -o "gc_comp.txt" -p
83
85
```
84
-
**It is totally fine, just press Enter and proceed or leave it until it tells you "Compressed Successsfully" or "Decompressed Successfully"**.
86
+
```bash
87
+
Reading files, Can take 1 minute or something ...
88
+
Running CScript.exe to convert xls file to csv for better performance
85
89
86
-
The error is due to some parallelization library bug that has nothing to do with the tool so it is ok.
90
+
Microsoft (R) Windows Script Host Version 5.812
91
+
Copyright (C) Microsoft Corporation. All rights reserved.
87
92
88
-
**N.B.2 The progress bar of columns compression, it doesn't mean that the tool has finished because it needs still to write the answers. So you need to wait until "Compressed Successfully" or "Decompressed Successfully" message appears.**
**If your original excel file was big and of many rows and columns, it's better and faster to decompress it into a csv file instead of excel directly and then save the file as excel if excel type is necessary. This is because python is not that fast in writing data to excel as well as the tool sometimes has "Corrupted Files" issues with excel.**
P.S. The tool takes a couple of seconds from 8 to 15 seconds to start working and compressing at the first time and then it runs faster and faster the more you use it.
201
+
#### Notes on the Tool
202
+
203
+
**1- compression is much faster than decompression, it is good to compress sequentially and decompress in parallel.**
204
+
205
+
**2- This error message can appear while compressing or decompressing in parallel**
lzhw.exe: error: the following arguments are required: -f/--input, -o/--output
210
+
```
211
+
**It is totally fine, just press Enter and proceed or leave it until it tells you "Compressed Successsfully" or "Decompressed Successfully"**.
212
+
213
+
The error is due to some parallelization library bug that has nothing to do with the tool so it is ok.
214
+
215
+
**3- The progress bar of columns compression, it doesn't mean that the tool has finished because it needs still to write the answers. So you need to wait until "Compressed Successfully" or "Decompressed Successfully" message appears.**
216
+
217
+
**4- The tool takes a couple of seconds from 8 to 15 seconds to start working and compressing at the first time and then it runs faster and faster the more you use it.**
190
218
191
219
#### Developing the Tool Using PyInstaller
192
220
In case you have python installed and you want to develop the tool yourself. Here is how to do it:
Sometimes the tool gives memmapping warning while running, so to suppress those warnings, in the *spec* file we can write **[('W ignore', None, 'OPTION')]** inside **exe = EXE()**.
242
+
Sometimes the tool gives memmapping warning while running, so to suppress those warnings, in the *spec* file we can write **[('W ignore', None, 'OPTION')]** inside **exe = EXE()**. and then **pyinstaller lzhw_cli.spec**.
243
+
244
+
##### Reference
245
+
[1] Dua, D. and Graff, C. (2019). UCI Machine Learning Repository [http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, School of Information and Computer Science.
0 commit comments