Pages

Topics

Tools

↑↓navigate↵openescclose

All syntax guides

Short, practical guides on programming syntax, language fundamentals, and the tools developers reach for every day.

3,965 guides across 14 topics

Topics

Latest guides

Illustration of Jinja2 template with custom filter and macro symbols representing transformation and reusable components.
Python

Python Jinja2 Custom Filters and Macros

Learn how to create custom filters and macros in Python Jinja2 templates. Includes syntax, practical examples, macro imports, and guidance on when to use each.

Jinja2PythonCustom FiltersMacros
Illustration of a Jinja2 template with variables, loops, and conditions generating dynamic output.
Python

Python Jinja2 Templates: Variables, Loops, and Conditions

Learn how Jinja2 variables, for loops, and if conditions work in Python templates, including filters, undefined-variable handling, whitespace control, and performance tips.

Jinja2PythonTemplatingVariables
A diagram showing an XML document with nested elements and attributes transforming into a Python dictionary structure with @ prefixes.
Python

Parsing Nested XML and Attributes with Python xmltodict

Learn how to use xmltodict to parse nested XML into dictionaries, read attributes with the @ prefix, handle repeated elements and namespaces, and write XML back out.

xmltodictXML parsingPython dictionariesattributes
A diagram showing XML data on the left transforming into a Python dictionary on the right, and back again, representing bidirectional conversion.
Python

Convert XML to Dictionary and Back with Python xmltodict

Learn how to use Python's xmltodict to convert XML to dictionaries and back, including attribute handling, namespaces, round-trip limitations, and when to prefer ElementTree.

xmltodictXML parsingPython dictionariesXML serialization
Comparison of Python msgpack and JSON serialization formats showing binary vs text data
Python

Python msgpack vs JSON: Choosing a Serialization Format

python msgpack vs json: Compare Python msgpack and JSON for serialization: data types, performance, compatibility, and practical guidance for choosing the right format.

msgpackJSONPython serializationdata interchange
Diagram showing Python objects being converted to compact msgpack binary format and back.
Python

Python msgpack: Serialize and Deserialize Python Objects

Learn how to use the Python msgpack library to serialize and deserialize objects: core API, type mapping, custom classes, limitations, and safety.

msgpackserializationpythonbinary protocol
Editorial illustration comparing orjson and the standard json module, with a speed-focused visual metaphor for Python serialization.
Python

Python orjson vs json performance: API differences

Compare Python's standard json module with orjson: API differences, type support, and performance tradeoffs that matter in production.

orjsonjson serializationpython performancepython standard library
Diagram showing orjson converting a dataclass with datetime and numpy array to JSON, with a pydantic model in the background.
Python

Python orjson: Serializing Dataclasses with datetime, numpy, and pydantic

python orjson datetime dataclass numpy and pydantic: Learn how to serialize Python dataclasses with datetime and numpy types using orjson, and how pydantic models fit...

orjsondataclassesdatetimenumpy
Illustration of Python orjson serializing a dictionary into compact JSON bytes with speed and efficiency.
Python

Python orjson: dumps, loads, and serialization options

Use Python's orjson library for fast JSON serialization. Learn orjson.dumps and orjson.loads options, dataclass support, datetime and UUID handling, and key differences from the standard json module.

orjsonJSON serializationPython performancedataclasses
Side-by-side comparison of prettytable and tabulate table formatting in Python
Python

python prettytable vs tabulate: Which to Use?

Compare Python prettytable and tabulate for formatting tabular data: API style, customization, output formats, performance, and when to choose each.

prettytabletabulate