Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Python binding for kmod

Project Description

kmodpy is a Python ctypes wrapper module for libkmod, exposing common module operations: listing installed modules, modprobe, modinfo, show_depends and rmmod.

Example (executed as root)

>>> import kmodpy
>>> km = kmodpy.Kmod()
>>> [m for m in km.list()]
[(u'nfs', 407706),
 (u'nfs_acl', 12741)
 (u'virtio_blk', 17549)]
>>> km.modprobe("loop", extra_options="max_loop=8")
>>> km.rmmod("loop")
>>> list(km.modinfo("loop"))
[('alias', 'char-major-10-237'), ('alias', 'block-major-7-*'),
 ('license', 'GPL'), ('parm', 'max_part:Maximum number of
 partitions per loop device'), ('parmtype', 'max_part:int'),
 ('parm', 'max_loop:Maximum number of loop
 devices'), ('parmtype', 'max_loop:int'), ('depends', ''),
 ('intree', 'Y'), ('vermagic', '3.12-1-amd64 SMP mod_unload
 modversions '), ('alias', 'devname:loop-control')]
>>> list(km.show_depends("ext4"))
['mbcache', 'crc16', 'jbd2']

Release History

This version
History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(20.1 kB) Copy SHA256 Hash SHA256
Source None Mar 28, 2014

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Google Google Cloud Servers Fastly Fastly CDN StatusPage StatusPage Statuspage DigiCert DigiCert EV Certificate