Data Persistence and Formats
pickle, shelve, sqlite3, dbm, json, csv, tomllib, configparser, xml and html.
This is an overview — pick a sub-topic below.
Sub-topics (9)
json
Read and write JSON — the standard format for APIs and config files.
csv
Read and write comma-separated files correctly (quoting, delimiters).
sqlite3
A full SQL database in a single file, built into Python.
pickle
Serialise almost any Python object to bytes and back.
shelve and dbm
Persistent dictionary-like storage on disk.
tomllib
Parse TOML files such as pyproject.toml (read-only, 3.11+).
configparser
Read and write INI-style configuration files.
xml
Parse and build XML with xml.etree.ElementTree (plus DOM and SAX APIs).
html
Escape and unescape HTML text, plus a simple HTML parser.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.