Version 1 (modified by james, 9 years ago)
move from code snippets page

Open a local package as a yum package object w/o all the rest of the yum stuff:

import yum.packages
import rpmUtils.transaction
ts = rpmUtils.transaction.initReadOnlyTransaction()
lp = yum.packages.YumLocalPackage(ts, '/home/skvidal/yum-3.2.8-1.noarch.rpm')

replace '/home/skvidal/yum-3.2.8-1.noarch.rpm' with the full path to the package