1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00
Files
jc/docs/parsers/plist.md

69 lines
1.3 KiB
Markdown
Raw Normal View History

2022-07-31 16:14:04 -07:00
[Home](https://kellyjonbrazil.github.io/jc/)
<a id="jc.parsers.plist"></a>
# jc.parsers.plist
jc - JSON Convert PLIST file parser
Converts binary and XML PLIST files.
2022-08-04 11:43:49 -07:00
Binary values are converted into an ASCII hex representation.
Datetime objects are converted into Unix epoch timestamps and ISO strings.
The timestamp and ISO string will maintain the same naive or timezone-aware
properties as the object in the original PLIST file.
2022-07-31 16:14:04 -07:00
Usage (cli):
$ cat file.plist | jc --plist
Usage (module):
import jc
result = jc.parse('plist', plist_command_output)
Schema:
[
{
"plist": string,
"bar": boolean,
"baz": integer
}
]
Examples:
$ plist | jc --plist -p
[]
$ plist | jc --plist -p -r
[]
<a id="jc.parsers.plist.parse"></a>
### parse
```python
def parse(data: Union[str, bytes],
raw: bool = False,
quiet: bool = False) -> Dict
```
Main text parsing function
Parameters:
data: (string) text data to parse
raw: (boolean) unprocessed output if True
quiet: (boolean) suppress warning messages if True
Returns:
List of Dictionaries. Raw or processed structured data.
### Parser Information
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)