โมดูล json ใน standard library ใช้ encode/decode JSON ฟังก์ชัน json.dumps() แปลง Python object → JSON string ตัวอย่างพื้นฐาน j {pen: 25, pencil: 10, book: 100, sharpner: 5, eraser: 5} ตัวเลือกที่ใช้บ่อย json.dumps({msg: สวัสดี}, ensure_ascii=False) {msg: สวัสดี} การแปลงกลับ (Decode) json.loads