2021-12-21 12:14:20 -08:00
|
|
|
[Home](https://kellyjonbrazil.github.io/jc/)
|
2022-01-25 17:07:47 -08:00
|
|
|
<a id="jc.parsers.zipinfo"></a>
|
2021-12-21 12:14:20 -08:00
|
|
|
|
|
|
|
# jc.parsers.zipinfo
|
2022-01-25 17:07:47 -08:00
|
|
|
|
2021-12-21 12:14:20 -08:00
|
|
|
jc - JSON CLI output utility `zipinfo` command output parser
|
|
|
|
|
|
|
|
Options supported:
|
|
|
|
- none
|
|
|
|
|
|
|
|
Note: The default listing format.
|
|
|
|
|
|
|
|
Usage (cli):
|
|
|
|
|
2022-01-25 17:07:47 -08:00
|
|
|
$ zipinfo <archive> | jc --zipinfo
|
2021-12-21 12:14:20 -08:00
|
|
|
|
2022-01-25 17:07:47 -08:00
|
|
|
or
|
2021-12-21 12:14:20 -08:00
|
|
|
|
2022-01-25 17:07:47 -08:00
|
|
|
$ jc zipinfo
|
2021-12-21 12:14:20 -08:00
|
|
|
|
|
|
|
Usage (module):
|
|
|
|
|
2022-01-25 17:07:47 -08:00
|
|
|
import jc
|
|
|
|
result = jc.parse('zipinfo', zipinfo_command_output)
|
2022-01-18 15:38:03 -08:00
|
|
|
|
2022-01-25 17:07:47 -08:00
|
|
|
or
|
2022-01-18 15:38:03 -08:00
|
|
|
|
2022-01-25 17:07:47 -08:00
|
|
|
import jc.parsers.zipinfo
|
|
|
|
result = jc.parsers.zipinfo.parse(zipinfo_command_output)
|
2021-12-21 12:14:20 -08:00
|
|
|
|
|
|
|
Schema:
|
2021-12-21 13:42:24 -08:00
|
|
|
|
2022-01-25 17:07:47 -08:00
|
|
|
[
|
|
|
|
{
|
|
|
|
"archive": string,
|
|
|
|
"size": integer,
|
|
|
|
"size_unit": string,
|
|
|
|
"number_entries": integer,
|
|
|
|
"number_files": integer,
|
|
|
|
"bytes_uncompressed": integer,
|
|
|
|
"bytes_compressed": integer,
|
|
|
|
"percent_compressed": float,
|
|
|
|
"files": [
|
|
|
|
{
|
|
|
|
"flags": string,
|
|
|
|
"zipversion": string,
|
|
|
|
"zipunder": string
|
|
|
|
"filesize": integer,
|
|
|
|
"type": string,
|
|
|
|
"method": string,
|
|
|
|
"date": string,
|
|
|
|
"time": string,
|
|
|
|
"filename": string
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
**Examples**:
|
|
|
|
|
|
|
|
|
|
|
|
$ zipinfo log4j-core-2.16.0.jar | jc --zipinfo -p
|
|
|
|
|
|
|
|
[
|
|
|
|
{
|
|
|
|
- `"archive"` - "log4j-core-2.16.0.jar",
|
|
|
|
- `"size"` - 1789565,
|
|
|
|
- `"size_unit"` - "bytes",
|
|
|
|
- `"number_entries"` - 1218,
|
|
|
|
- `"number_files"` - 1218,
|
|
|
|
- `"bytes_uncompressed"` - 3974141,
|
|
|
|
- `"bytes_compressed"` - 1515455,
|
|
|
|
- `"percent_compressed"` - 61.9,
|
|
|
|
- `"files"` - [
|
|
|
|
{
|
|
|
|
- `"flags"` - "-rw-r--r--",
|
|
|
|
- `"zipversion"` - "2.0",
|
|
|
|
- `"zipunder"` - "unx",
|
|
|
|
- `"filesize"` - 19810,
|
|
|
|
- `"type"` - "bl",
|
|
|
|
- `"method"` - "defN",
|
|
|
|
- `"date"` - "21-Dec-12",
|
|
|
|
- `"time"` - "23:35",
|
|
|
|
- `"filename"` - "META-INF/MANIFEST.MF"
|
|
|
|
},
|
|
|
|
...
|
|
|
|
|
|
|
|
<a id="jc.parsers.zipinfo.info"></a>
|
|
|
|
|
|
|
|
## info Objects
|
|
|
|
|
2021-12-21 12:14:20 -08:00
|
|
|
```python
|
2022-01-25 17:07:47 -08:00
|
|
|
class info()
|
2021-12-21 12:14:20 -08:00
|
|
|
```
|
2022-01-25 17:07:47 -08:00
|
|
|
|
2021-12-21 12:14:20 -08:00
|
|
|
Provides parser metadata (version, author, etc.)
|
|
|
|
|
2022-01-25 17:07:47 -08:00
|
|
|
<a id="jc.parsers.zipinfo.parse"></a>
|
|
|
|
|
|
|
|
#### parse
|
|
|
|
|
2021-12-21 12:14:20 -08:00
|
|
|
```python
|
2022-01-25 17:07:47 -08:00
|
|
|
def parse(data, raw=False, quiet=False)
|
2021-12-21 12:14:20 -08:00
|
|
|
```
|
|
|
|
|
|
|
|
Main text parsing function
|
|
|
|
|
2022-01-25 17:07:47 -08:00
|
|
|
**Arguments**:
|
2021-12-21 12:14:20 -08:00
|
|
|
|
2022-01-25 17:07:47 -08:00
|
|
|
|
|
|
|
- `data` - (string) text data to parse
|
|
|
|
- `raw` - (boolean) unprocessed output if True
|
|
|
|
- `quiet` - (boolean) suppress warning messages if True
|
|
|
|
|
2021-12-21 12:14:20 -08:00
|
|
|
|
2022-01-25 17:07:47 -08:00
|
|
|
**Returns**:
|
2021-12-21 12:14:20 -08:00
|
|
|
|
2022-01-25 17:07:47 -08:00
|
|
|
|
|
|
|
List of Dictionaries. Raw or processed structured data.
|
2021-12-21 12:14:20 -08:00
|
|
|
|
|
|
|
## Parser Information
|
|
|
|
Compatibility: linux, darwin
|
|
|
|
|
|
|
|
Version 0.01 by Matt J (https://github.com/listuser)
|