use tempfile and io, not os and codecs, for Python 3 compatibility
Fix to the example in README.md (which used a deprecated endpoint)