Handles creation, mounting, and compression of MacOS sparse disk images
Install PySparseMac from here or with pip (soon)
pip install pysparsemac
I have another project that automates a service backup. I decided I wanted to write all of the files to a disk image and compress it in an automated fashion. This is the result, a wrapper around hdiutil
.
creates an uncompressed disk image at specificed location.
path: full path (directory and filename) of uncompressed disk image to be created
name: volume name of the mounted disk image
size: size of uncompressed disk image
mount the disk image previously created.
path: full path (directory and filename) of uncompressed disk image
unmounts a mounted disk image.
vol_id: Volume ID of the disk to unmount
creates a compressed ULMO format disk in the same directory as the uncompressed disk.
path: full path (directory and filename) of uncompressed disk image to be compressed
move compressed disk to different location.
path: full path (directory and filename) of compressed disk image to be moved
destination_dir: destination to move disk to
runs through the full suite of functions to demonstrate the module.
import pysparsemac
pysparsemac.demo_it()
Version | Date | Notes |
---|---|---|
0.0.1 | 2024.05.18 | Initial release, thanks PyCon24! Demo. |
0.0.2 | 2024.05.19 | Added types |
0.0.3 | 2024.06.18 | Cleaned up, prepare for Github/PyPI |
0.0.4 | 2024.06.20 | Removed types |
0.0.5 | 2024.06.28 | Error checking, exceptions |
0.1.0 | 2024.06.29 | Public release |
0.1.1 | 2024.07.03 | reworked suprocess calls, destination path, compressed path synthesis |
Things to do...
- Docs
- PyPI
- more error checking
- more exception messages
- more comments
- functions return dict with success field, etc
- function to dispose of uncompressed image
- better function names, more readable variables in the demo function, make it easier to follow
- Add more integrations(?)
@lazymutt Todd McDaniel