Package: sif
# SIF (Python)Sif Python (sif) is the Python API for working with the Singularity SIF imageformat. This library is under development, and contributions are welcome!The basic functionality so far is to parse the header, only using Python:```from sif.main import SIFHeaderSIFHeader('boxes.simg')boxes.simg is a SIF file.SIF Header version 01SIF Header arch 02SIF Header uuid 0eae46df-1975-e44c-888b-8b9915f87f52SIF Header ctime 1544537033SIF Header mtime 1546726508SIF Header dfree 45SIF Header dtotal 48SIF Header descroff 4096SIF Header descrlen 28080SIF Header dataoff 32768SIF Header datalen 196953019Architecture: AMD64 arch codeDeffile Datatype 16385Deffile Used TrueDeffile ID 1Deffile Groupid 4026531841Deffile Link 0Deffile Fileoff 32768Deffile Filelen 39Deffile Storelen 39Deffile Ctime 1544537033Deffile Mtime 1544537033Deffile UID 0Deffile Gid 0Deffile name .Deffile extraPartition Datatype 16388Partition Used TruePartition ID 2Partition Groupid 4026531841Partition Link 0Partition Fileoff 36864Partition Filelen 196947968Partition Storelen 196952025Partition Ctime 1544537033Partition Mtime 1544537033Partition UID 0Partition Gid 0Partition name squashfs-955608129.imgPartition fstype 1Partition partype 2Partition extra 02Signature Datatype 16389Signature Used TrueSignature ID 3Signature Groupid 4026531841Signature Link 2Signature Fileoff 196984832Signature Filelen 955Signature Storelen 955Signature Ctime 1546726508Signature Mtime 1546726508Signature UID 0Signature Gid 0Signature name part-signatureSignature hastype 2Signature publicKey -----BEGIN PGP SIGNED MESSAGE-----Hash: SHA256SIFHASH:4de3d88a550a8c1976b54b91445b027af718cb0bf38133c50dcd723fdba54a28177008e2f4bb7e7cc81aa4d82c0c27fa-----BEGIN PGP SIGNATURE-----wsFcBAEBCAAQBQJcMSxrCRBi+gdpIWqw6QAAiZsQAAJgTPQ5QVuiLq0s7PAM9gPKYLmxEN3UiTS0BF2a/DffKmYMCdrZwKyx0fybWZMOAREfobTbbqNhL0dvk6idMtfRwvHSDmKl1gx9LZ764ddyaX/NdsHZMrtDLBe2AMuCoAEZOpN0/BQQRiuQMYBbWiVz3DMyvvqXdzKnc6OYu1wBlr+q0GG2I4HRGGfZayZUHtgh4okPVJSndxgD5Rz1zeC5GZUiHJyh3Jru8wc7hEivgHGXRfP5S+VedrGYX/gam/iH26t/nMGY7AFN5IIMr1t0I54HCJCf0NcwTfruzwwE80d6+BrLa082uuS6qD+PKhyEaqm8jZVFw2On9EJuIkjeR6f3Q2IagrOHh/axGrXMUcSA6tBkw0IRbS/NBw/0hjpiRLCOY5C+qp4WWS+Oo34k09eO4UmlDkKTScc72yxNRTAMBc0f/o5pncirXVCwbUMAMkMsZOBS8lN72WFDGzk4mnOTsiBntG29ryjtWQctKWJN+M7v8s8ib+iFCgBJbMyBR//z4z1OkkCUDxee5bvFbnvAVpEpOj0DvOmH/2za3Olyoez3ueGo5HNCfbKq4FBgKo/KB3cIp41cVcohSpSVzgtARAKG1paRof+zXP0xatL+TDXazytRyNgXrprJbrZvjm4/jXhhT31D8s/8kZx1hK2q7TKN3URs6h7olmt+=E8Je-----END PGP SIGNATURE-----```## UsageBy default, the SIF header version provided is the most up to date with Singularity.If you need to specify a particular header, set the environment variable for it:```bashSIF_VERSION="02"export SIF_VERSION```### PythonIn Python, you will likely want to start with an image, and load it for inspection.The client will quickly tell you if it's a SIF header or not based on the `SIF_MAGIC`after the interpreter line:**This is a SIF image**```pythonimage = 'salad.simg'from sif.main import SIFHeaderheader = SIFHeader(image)boxes.simg is a SIF file.Architecture: AMD64 arch codeFound SIF version 01Found SIF arch 02```You don't have to load the header right away:```pythonheader = SIFHeader('boxes.simg', load=False)boxes.simg is a SIF file.header.load_header()Architecture: AMD64 arch codeFound SIF version 01Found SIF arch 02```**This is not a SIF image**```pythonimage = 'salad.simg'from sif.main import SIFHeaderheader = SIFHeader(image)...ERROR salad.simg is not a SIF file.```## LicensesThis code is licensed under the Affero GPL, version 3.0 or later [LICENSE](LICENSE).The SIF Header format is licesed by [Sylabs](https://github.com/sylabs/sif/blob/master/pkg/sif/sif.go).