python-scsi is a SCSI initiator for python. It contains python classes to create and send SCSI commands to devices accessible via:
SGIO: /dev/sg* devices using ioctl(SG_IO) Only available for Linux
iSCSI: iscsi://// Available on all platforms which have libiscsi-python See https://github.com/sahlberg/libiscsi-python
These classes also provide interfaces to marshall/unmarshall both CDBs as well as DATA-IN/OUT buffers.
Python-scsi is distributed under LGPLv2.1 Please see the LICENSE file for the full license text.
Getting the sources
The module is hosted at https://github.com/rosjat/python-scsi
You can use git to checkout the latest version of the source code using:
$ git clone firstname.lastname@example.org:rosjat/python-scsi.git
It is also available as a downloadable zip archive from:
Building and installing
$ apt install swig libiscsi-dev
Building the module:
$ python setup.py build
Installing the module:
$ python setup.py install
The tests directory contain unit tests for python-scsi. To run the tests:
$ cd tests $ make
The tools directory contains example programs written against the python-scsi API.
An example tool to send INQUIRY commands to a device.
An example tool to operate a SCSI media changer. Similar to, but not as advanced as, the 'mtx' utility.
A mailinglist for python-scsi is available at: https://groups.google.com/forum/#!forum/python-scsi