• Stars
    star
    7
  • Rank 2,294,772 (Top 46 %)
  • Language
    HTML
  • License
    GNU General Publi...
  • Created almost 10 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python bindings to hwdata

python-hwdata

Provides python interface to database stored in hwdata package. It allows you to get human readable description of USB and PCI devices.

PyPI version PyPI - License

Example

#!/usr/bin/python

from hwdata import PCI, USB, PNP

# for obtaining real id of your devices you can use package python-gudev

pci_vendor_id = '1002'
pci_device_id = '687f'
pci_subsystem_id = '1043:04c4'

usb_vendor_id = '03f0'
usb_device_id = '1f12'


pci = PCI()
print("Vendor: %s" % pci.get_vendor(pci_vendor_id))
print("Device: %s" % pci.get_device(pci_vendor_id, pci_device_id))
print("Subsystem: %s" % pci.get_subsystem(pci_vendor_id, pci_device_id, pci_subsystem_id))


usb = USB()
print("Vendor: %s" % usb.get_vendor(usb_vendor_id))
print("Device: %s" % usb.get_device(usb_vendor_id, usb_device_id))

pnp = PNP()
print("Vendor: %s" $ pnp.get_vendor('AAA'))

Upstream

https://github.com/xsuchy/python-hwdata

Build package

When you run:

tito build --tgz

you will get latest tar.gz file.

When you run:

tito build --rpm

you will get latest rpm package.

Distributions

This package is present in Fedora and EPEL. You should be able to just dnf install python-hwdata.

License

GPL-2.0-or-later