Configurable JSON encoder for publishing Python objects as JSON documents