Real Python
  • Start Here
  • Learn Python
    Python Tutorials →
    In-depth articles and video courses
    Learning Paths →
    Guided study plans for accelerated learning
    Quizzes & Exercises →
    Check your learning progress
    Browse Topics →
    Focus on a specific area or skill level
    Community Chat →
    Learn with other Pythonistas
    Office Hours →
    Live Q&A calls with Python experts
    Podcast →
    Hear what’s new in the world of Python
    Books →
    Round out your knowledge and learn offline
    Reference →
    Concise definitions for common Python terms
    Code Mentor →Beta
    Personalized code assistance & learning tools
    Unlock All Content →
  • More
    Learner Stories Python Newsletter Python Job Board Meet the Team Become a Tutorial Writer Become a Video Instructor
  • Search
/
  • Join
  • Sign‑In

— FREE Email Series —

🐍 Python Tricks 💌

Python Tricks Dictionary Merge

🔒 No spam. Unsubscribe any time.

Browse Topics Guided Learning Paths
Basics Intermediate Advanced
ai algorithms api best-practices career community databases data-science data-structures data-viz devops django docker editors flask front-end gamedev gui machine-learning news numpy projects python stdlib testing tools web-dev web-scraping

Table of Contents

  • Get an Overview of Data Serialization
  • Compare Data Serialization Formats
    • Textual vs Binary
    • Schemaless vs Schema-Based
    • General-Purpose vs Specialized
    • Portable vs Python-Specific
  • Serialize Python Objects
    • Pickle Your Python Objects
    • Customize the Pickling Process
    • Encode Objects Using JSON
    • Use Formats Foreign to Python
  • Serialize Executable Code
    • Pickle Importable Symbols
    • Serialize Python Modules
    • Serialize Code Objects
    • Protect From Malicious Code
  • Serialize HTTP Message Payloads
    • Build a REST API Using Flask
    • Serialize Django Models With DRF
    • Leverage FastAPI for Performance
    • Parse JSON Responses With Pydantic
  • Serialize Hierarchical Data
    • Textual: XML, YAML, and JSON
    • Binary: BSON
  • Serialize Tabular Data
    • Textual Spreadsheets: CSV
    • Binary DataFrames: Parquet
  • Serialize Schema-Based Data
    • Big Data: Apache Avro
    • Microservices: Protocol Buffers
  • Conclusion