mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
add schema docs for pci-ids
This commit is contained in:
@ -9,6 +9,28 @@ This parser converts the pci.ids database file.
|
|||||||
|
|
||||||
https://raw.githubusercontent.com/pciutils/pciids/master/pci.ids
|
https://raw.githubusercontent.com/pciutils/pciids/master/pci.ids
|
||||||
|
|
||||||
|
A nested schema allows straightforward queries with tools like `jq`. Hex id
|
||||||
|
numbers are prefixed with an underscore (`_`) so bracket notation is not
|
||||||
|
necessary when referencing. For example:
|
||||||
|
|
||||||
|
$ cat pci.ids | jc --pci-ids | jq '.vendors._9005._0053._9005._ffff.subsystem_name'
|
||||||
|
"AIC-7896 SCSI Controller mainboard implementation"
|
||||||
|
|
||||||
|
Here are the vendor and class mappings:
|
||||||
|
|
||||||
|
jq '.vendors._001c._0001._001c._0005.subsystem_name'
|
||||||
|
| | | |
|
||||||
|
| | | subdevice
|
||||||
|
| | subvendor
|
||||||
|
| device
|
||||||
|
vendor
|
||||||
|
|
||||||
|
jq '.classes._0c._03._40'
|
||||||
|
| | |
|
||||||
|
| | prog_if
|
||||||
|
| subclass
|
||||||
|
class
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
$ cat pci.ids | jc --pci-ids
|
$ cat pci.ids | jc --pci-ids
|
||||||
@ -20,21 +42,36 @@ Usage (module):
|
|||||||
|
|
||||||
Schema:
|
Schema:
|
||||||
|
|
||||||
[
|
{
|
||||||
{
|
"vendors": {
|
||||||
"pci-id": string,
|
"_<vendor_id>": {
|
||||||
"bar": boolean,
|
"vendor_name": string,
|
||||||
"baz": integer
|
"_<device_id>": {
|
||||||
|
"device_name": string,
|
||||||
|
"_<subvendor_id>": {
|
||||||
|
"_<subdevice_id": string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"_<class_id>": {
|
||||||
|
"class_name": string,
|
||||||
|
"_<subclass_id>": {
|
||||||
|
"subclass_name": string,
|
||||||
|
"_<prog_if>": string
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
$ cat pci.ids | jc --pci-id -p
|
$ cat pci.ids | jc --pci-ids | jq '.vendors._001c._0001._001c._0005.subsystem_name'
|
||||||
[]
|
"2 Channel CAN Bus SJC1000 (Optically Isolated)"
|
||||||
|
|
||||||
$ cat pci.ids | jc --pci-id -p -r
|
$ cat pci.ids | jc --pci-ids | jq '.classes._0c._03._40'
|
||||||
[]
|
"USB4 Host Interface"
|
||||||
|
|
||||||
<a id="jc.parsers.pci_ids.parse"></a>
|
<a id="jc.parsers.pci_ids.parse"></a>
|
||||||
|
|
||||||
|
@ -4,6 +4,28 @@ This parser converts the pci.ids database file.
|
|||||||
|
|
||||||
https://raw.githubusercontent.com/pciutils/pciids/master/pci.ids
|
https://raw.githubusercontent.com/pciutils/pciids/master/pci.ids
|
||||||
|
|
||||||
|
A nested schema allows straightforward queries with tools like `jq`. Hex id
|
||||||
|
numbers are prefixed with an underscore (`_`) so bracket notation is not
|
||||||
|
necessary when referencing. For example:
|
||||||
|
|
||||||
|
$ cat pci.ids | jc --pci-ids | jq '.vendors._9005._0053._9005._ffff.subsystem_name'
|
||||||
|
"AIC-7896 SCSI Controller mainboard implementation"
|
||||||
|
|
||||||
|
Here are the vendor and class mappings:
|
||||||
|
|
||||||
|
jq '.vendors._001c._0001._001c._0005.subsystem_name'
|
||||||
|
| | | |
|
||||||
|
| | | subdevice
|
||||||
|
| | subvendor
|
||||||
|
| device
|
||||||
|
vendor
|
||||||
|
|
||||||
|
jq '.classes._0c._03._40'
|
||||||
|
| | |
|
||||||
|
| | prog_if
|
||||||
|
| subclass
|
||||||
|
class
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
$ cat pci.ids | jc --pci-ids
|
$ cat pci.ids | jc --pci-ids
|
||||||
@ -15,21 +37,36 @@ Usage (module):
|
|||||||
|
|
||||||
Schema:
|
Schema:
|
||||||
|
|
||||||
[
|
{
|
||||||
{
|
"vendors": {
|
||||||
"pci-id": string,
|
"_<vendor_id>": {
|
||||||
"bar": boolean,
|
"vendor_name": string,
|
||||||
"baz": integer
|
"_<device_id>": {
|
||||||
|
"device_name": string,
|
||||||
|
"_<subvendor_id>": {
|
||||||
|
"_<subdevice_id": string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"_<class_id>": {
|
||||||
|
"class_name": string,
|
||||||
|
"_<subclass_id>": {
|
||||||
|
"subclass_name": string,
|
||||||
|
"_<prog_if>": string
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
$ cat pci.ids | jc --pci-id -p
|
$ cat pci.ids | jc --pci-ids | jq '.vendors._001c._0001._001c._0005.subsystem_name'
|
||||||
[]
|
"2 Channel CAN Bus SJC1000 (Optically Isolated)"
|
||||||
|
|
||||||
$ cat pci.ids | jc --pci-id -p -r
|
$ cat pci.ids | jc --pci-ids | jq '.classes._0c._03._40'
|
||||||
[]
|
"USB4 Host Interface"
|
||||||
"""
|
"""
|
||||||
import re
|
import re
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
2
man/jc.1
2
man/jc.1
@ -1,4 +1,4 @@
|
|||||||
.TH jc 1 2022-10-19 1.22.1 "JSON Convert"
|
.TH jc 1 2022-10-21 1.22.1 "JSON Convert"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types, and strings
|
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types, and strings
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
Reference in New Issue
Block a user