This is a simple Python script I used to manipulate a DS3231 attached to the I2C bus on a CHIP running Debian 8 Linux. It can be used as a SysV init script, to save the current time at power off and load it again on power up. Or as a module in some other project via the DS3231 class.
I grant a license to use, distribute, alter and do whatever you want with it, other than excluding others from doing the same.
As free software, in both senses of the word, there is absolutley no warranty for this software. It works on my devices and unless you alter it, it shouldn't eat your children. :-D
You can find out more from my website. And further details are on the CHIP forums.
Have fun and keep your children safe!