Python Json Without Whitespace

January 12, 2019
import json

data = {'name': 'Desmond', 'skills': ['python', 'kotlin', 'javascript']}

json.dumps(data, separators=(',', ':'))
# '{"skills":["python","kotlin","javascript"],"name":"Desmond"}'

References:

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.