TATECHATLAS
◎ English
Home / Topics

Programming: Python, Git and code examples

Python and Git guides covering dependencies, environments, change history and code examples with explanations and primary sources.

Choose the problem you need to solve: a Python environment, package imports or Git history. Check commands against your tool version and the conditions of your project.

Materials

20 materials

How json.loads and json.load handle bytes and bytearray in Python: encoding auto-detection and the strict parameter

The json.loads and json.load functions in Python accept bytes and bytearray inputs since version 3.6, automatically detecting UTF-8, UTF-16, or UTF-32 encoding. If the encoding is incorrect, UnicodeDecodeError is raised. The strict parameter controls handling of control characters in JSON strings. Practical scenarios and limitations are discussed.

Python 3.6+ / JSON / bytes and bytearray / UTF-8/UTF-16/UTF-32 / UnicodeDecodeError / strict parameter / pathlib / binary files

Mastering JSON Output Formatting in Python

Learn how to control JSON serialization using separators, indentation, key sorting, and ASCII encoding to optimize for machine or human readability.

python / json / serialization / formatting / api / debugging / encoding / data-interchange

Entry Points in pyproject.toml

Learn to declare entry points in pyproject.toml using the three supported tables. Avoid nested subtables and duplicate definitions to prevent installation errors.

Python / Packaging / pyproject.toml / Entry Points / CLI / Scripts

Robust CSV Parsing in Python: Handling BOM, Dialects, and Newlines

A guide to using the Python csv module to automatically detect delimiters, handle Unicode Byte Order Marks (BOM) with utf-8-sig, and manage platform-specific newline issues using the Sniffer class and correct file opening parameters.

python / csv / data-processing / encoding / utf-8-sig / automation

Serializing Complex Python Objects to JSON with Custom Encoders

Use default or a JSONEncoder subclass to convert unsupported Python values into an explicit JSON representation. An unhandled TypeError stops the whole dump. Add object_hook only when you need to reconstruct custom types from marker objects.

json / serialization / JSONEncoder / default / object_hook / python-standard-library / datetime / complex

Creating and using a wheelhouse for offline Python installs

A wheelhouse is a pre-built directory of wheels created on a network-connected build machine and installed offline on a target machine. Pin a requirements file, run pip wheel, archive with tar, then install with --no-index --no-deps --force-reinstall.

wheelhouse / offline-install / pip-wheel / repeatable-installs / hash-checking / requirements-file / pyproject-toml / build-dependencies

Safe Cross-Platform Path Handling in Python with pathlib

A practical guide to using pathlib for file existence checks, extension manipulation, directory navigation, and path resolution without introducing platform-specific bugs on Windows or Unix systems.

pathlib / cross-platform / python / file-system / os.PathLike / PurePath / glob / resolve

Relative Paths in Python: Terminal, IDE and Service Launches

How Python resolves relative paths depends on the process working directory, which varies by launcher. This guide shows how to inspect the working directory, choose and document an explicit path base, and understand why __file__ cannot always be trusted.

Python / pathlib / relative paths / working directory / __file__ / os.getcwd