The BaseDependency class defines various attributes for accessing the parts of a dependency. The attributes are as follows:
The dependency class represents a Or-Group of dependencies. It provides an attribute to access the BaseDependency object for the available choices.
The Origin class provides access to the origin of the package. It allows you to check the component, archive, the hostname, and even if this package can be trusted.
import apt
cache = apt.Cache()
pkg = cache['python-apt'] # Access the Package object for python-apt
print 'python-apt is trusted:', pkg.candidate.origins[0].trusted
# Mark python-apt for install
pkg.mark_install()
print 'python-apt is marked for install:', pkg.marked_install
print 'python-apt is (summary):', pkg.candidate.summary
# Now, really install it
cache.commit()