Browse by Topic

Popular

Latest

Latest Python Posts

A PDF document with a padlock icon representing encryption and decryption using Python pypdf.
Python

Encrypt and Decrypt PDFs with Python pypdf

Learn how to add user and owner passwords, set PDF permissions, decrypt protected files, and remove encryption using the Python pypdf library.

pypdfPDF encryptionPDF decryptionpassword protection
Illustration of a Python script manipulating PDF pages with pypdf, showing text extraction, merging, splitting, and rotation icons.
Python

Python pypdf: Extract Text, Merge, Split, and Rotate PDFs

Learn how to use the Python pypdf library to extract text, merge PDFs, split pages, and rotate pages. Includes practical examples and memory considerations.

pypdfPDF manipulationtext extractionPDF merging
Python Markdown document converting to a styled HTML table with syntax-highlighted code blocks.
Python

Python Markdown Tables and Code Highlighting Extensions

Enable tables, fenced code blocks, and Pygments-based syntax highlighting in Python-Markdown, with configuration examples and common pitfalls.

pythonmarkdownsyntax-highlightingtables
Illustration of a Jinja2 Environment loading template files and autoescaping output.
Python

Configuring a Jinja2 Environment with FileSystemLoader and Autoescape in Python

Use Jinja2's FileSystemLoader to load templates from disk, enable autoescape so HTML output is escaped by default, and handle template loading errors.

Jinja2PythonTemplate EngineAutoescape
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