API reference

Modules

zut.api

A JSON-oriented API client depending only on the Python standard library.

zut.build

Build helpers: get information about Git repositories, transpile makrdown files.

zut.callback

HTTP callback server, typically used for redirects of authorization flows.

zut.choices

Polyfills for Django's Choices classes so that shared libraries may define choice models without depending on Django.

zut.collection

Parse and convert lists and dicts.

zut.command

Define and run command-line interfaces.

zut.config

Extend ways to access ConfigParser sections.

zut.context

Information about the execution context: script path and name, user scopes, SID, etc.

zut.convert

Flexible conversion of types.

zut.csv

Write and read CSV using flexible format options.

zut.db

Generic database access and tools.

zut.db.base

Base abstraction to access different database backends.

zut.db.maria

Implementation of base Db adapter for the MariaDB database backend.

zut.db.mysql

Implementation of base Db adapter for the MySQL database backend.

zut.db.pg

Implementation of base Db adapter for the PostgreSQL database backend.

zut.db.sqlite

Implementation of base Db adapter for the SQLite database backend.

zut.db.sqlserver

Implementation of base Db adapter for the Sql Server database backend.

zut.env

Load .env files and read environment handling type conversions and default values.

zut.excel

Write and read Excel tables (requires zut[excel] extra: openpyxl defusedxml).

zut.file

Archivate files.

zut.geo

Find geographical libraries.

zut.gpg

Encryption and decryption with GnuPG.

zut.graph

Topological sort of dependency graphs

zut.json

Write and read JSON using extended encoder and decoder.

zut.locale

Registration of locales and retrieval of information about locales.

zut.logging

Configuration of logging and helpers for specific use cases.

zut.net

Resolve DNS with a timeout, check port status, determine proxy, etc.

zut.numeric

Parse and convert numbers.

zut.passwordstore

Manage passwords with GPG using pass file structure.

zut.path

Normalize and check paths, find paths to the root hierarchy, get default application directories.

zut.perf

Track elapsed time and memory consumption (requires zut[perf] extra: psutil).

zut.pip

Install PyPi dependencies with pip.

zut.process

Run processes and handle process errors (wrappers and extensions on stdlib's subprocess).

zut.secret

Define and resolve secrets.

zut.sql

Parse and transform SQL queries.

zut.tab

Provide a polyfill for the tabulate function to handle simple cases.

zut.term

Console ANSI colors and live, interactive Console output.

zut.text

Manage UTF8 BOM, fix encoding issues, generate slugs, provide flexible filters.

zut.time

Parse and convert dates, times and time zones.

zut.typing

Python typing helpers.

zut.unittest

Test runner wrapper and polyfills for unittest.

zut.url

Build and manipulate URLs.