Python and snappy

In this thread you can find an example which you can adapt to you needs: