Metadata-Version: 2.4
Name: zut
Version: 4.1.0
Summary: General-purpose utility Python library to minimize boilerplate code by reusing common code and patterns.
Author-email: Sébastien Hocquet <seb@ipamo.net>
License-Expression: MIT
Project-URL: Homepage, https://codeberg.org/ipamo/zut
Project-URL: Issuers, https://codeberg.org/ipamo/zut/issues
Keywords: reusable,util,utils,wheel,common,commons,base,shared,core,csv,db,database,load,bulk,insert,sqlite,postgresql,pg,mysql,maria,mariadb,sqlserver,mssql
Classifier: Development Status :: 5 - Production/Stable
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Provides-Extra: excel
Requires-Dist: openpyxl; extra == "excel"
Requires-Dist: defusedxml; extra == "excel"
Provides-Extra: tab
Requires-Dist: tabulate; extra == "tab"
Provides-Extra: time
Requires-Dist: tzlocal; (python_version < "3.9" or sys_platform == "win32") and extra == "time"
Requires-Dist: pytz; python_version < "3.9" and extra == "time"
Requires-Dist: tzdata; (python_version >= "3.9" and sys_platform == "win32") and extra == "time"
Provides-Extra: perf
Requires-Dist: psutil; extra == "perf"
Provides-Extra: sql
Requires-Dist: sqlparse; extra == "sql"
Provides-Extra: maria
Requires-Dist: mysqlclient; extra == "maria"
Requires-Dist: sqlparse; extra == "maria"
Provides-Extra: mysql
Requires-Dist: mysqlclient; extra == "mysql"
Requires-Dist: sqlparse; extra == "mysql"
Provides-Extra: pg
Requires-Dist: psycopg[binary]; extra == "pg"
Requires-Dist: sqlparse; extra == "pg"
Provides-Extra: sqlite
Requires-Dist: sqlparse; extra == "sqlite"
Provides-Extra: sqlserver
Requires-Dist: pyodbc; extra == "sqlserver"
Requires-Dist: sqlparams; extra == "sqlserver"
Requires-Dist: sqlparse; extra == "sqlserver"
Provides-Extra: all
Requires-Dist: openpyxl; extra == "all"
Requires-Dist: defusedxml; extra == "all"
Requires-Dist: tabulate; extra == "all"
Requires-Dist: tzlocal; (python_version < "3.9" or sys_platform == "win32") and extra == "all"
Requires-Dist: pytz; python_version < "3.9" and extra == "all"
Requires-Dist: tzdata; (python_version >= "3.9" and sys_platform == "win32") and extra == "all"
Requires-Dist: psutil; extra == "all"
Requires-Dist: sqlparse; extra == "all"
Requires-Dist: mysqlclient; extra == "all"
Requires-Dist: psycopg[binary]; extra == "all"
Requires-Dist: pyodbc; extra == "all"
Requires-Dist: sqlparams; extra == "all"
Dynamic: license-file

Zut
===

General-purpose utility Python library to minimize boilerplate code by reusing common code and patterns.


## Install

Zut is published [on PyPI](https://pypi.org/project/zut/).

Install with `pip`:

```sh
pip install zut
```

Zut is designed to work with the Python standard library (version >= 3.7) as its sole mandatory dependency.

Optional dependencies may be installed using an _extra_ specifier:

- `pip install zut[excel]` : write and read Excel files with module `zut.excel` (installs `openpyxl defusedxml`).
- `pip install zut[tab]` : display tabular data elegantly (installs `tabulate`). If this dependency is not included, the library provides a polyfill for the `tabulate` function to handle simple cases.
- `pip install zut[time]` : parse timezones from string, get local timezone name or convert between naive and aware datetimes in various timezones (installs `tzdata` and `tzlocal` on Windows; does not install anything on Linux if Python >= 3.9 because this feature is natively available).
- `pip install zut[perf]` : track elapsed time and memory consumption with module `zut.perf` (installs `psutil`).
- `pip install zut[sql]` : advanced SQL parsing in module `zut.sql` (installs `sqlparse`).

Database adapters:

- `pip install zut[maria]`: access MariaDB databases (installs `mysqlclient` and `sqlparse`).
- `pip install zut[mysql]`: access MySQL databases (installs `mysqlclient` and `sqlparse`).
- `pip install zut[pg]`: access PostgreSQL databases (installs `psycopg` and `sqlparse`).
- `pip install zut[sqlserver]`: access Microsoft SQL Server databases (installs `pyodbc`, `sqlparams` and `sqlparse`).
- `pip install zut[sqlite]`: access SQLite databases (installs `sqlparse`).

Use `pip install zut[all]` to install all _extras_.

## Features

| Module        | Summary
|---------------|------------------------------------------------------------------------------------------------------------------------------------
| [`zut.api`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/api.py) | A JSON-oriented API client depending only on the Python standard library.
| [`zut.build`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/build.py) | Build helpers: get information about Git repositories, transpile makrdown files.
| [`zut.callback`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/callback.py) | HTTP callback server, typically used for redirects of authorization flows.
| [`zut.choices`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/choices.py) | Polyfills for Django's `Choices` classes so that shared libraries may define choice models without depending on Django.
| [`zut.collection`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/collection.py) | Parse and convert lists and dicts.
| [`zut.command`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/command.py) | Define and run command-line interfaces.
| [`zut.config`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/config.py) | Extend ways to access `ConfigParser` sections.
| [`zut.context`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/context.py) | Information about the execution context: script path and name, user scopes, SID, etc.
| [`zut.convert`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/convert.py) | Flexible conversion of types.
| [`zut.csv`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/csv.py) | Write and read CSV using flexible format options.
| [`zut.db`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/db/__init__.py) | Generic database access and tools.
| [`zut.db.base`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/db/base.py) | Base abstraction to access different database backends.
| [`zut.db.maria`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/db/maria.py) | Adapter for MariaDB databases.
| [`zut.db.mysql`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/db/mysql.py) | Adapter for MySQL databases.
| [`zut.db.pg`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/db/pg.py) | Adapter for PostgreSQL databases.
| [`zut.db.sqlite`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/db/sqlite.py) | Adapter for SQLite databases.
| [`zut.db.sqlserver`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/db/sqlserver.py) | Adapter for Microsoft SQL Server databases.
| [`zut.env`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/env.py) | Load `.env` files and read environment handling type conversions and default values.
| [`zut.excel`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/excel.py) | Write and read Excel tables (requires `zut[excel]` extra: `openpyxl defusedxml`).
| [`zut.file`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/file.py) | Archivate files.
| [`zut.geo`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/geo.py) | Find geographical libraries.
| [`zut.gpg`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/gpg.py) | Encryption and decryption using GnuPG.
| [`zut.graph`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/graph.py) | Topological sort of dependency graphs
| [`zut.json`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/json.py) | Write and read JSON using extended encoder and decoder.
| [`zut.locale`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/locale.py) | Registration of locales and retrieval of information about locales.
| [`zut.logging`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/logging.py) | Configuration of logging and helpers for specific use cases.
| [`zut.net`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/net.py) | Resolve DNS with a timeout, check port status, determine proxy, etc.
| [`zut.numeric`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/numeric.py) | Parse and convert numbers.
| [`zut.passwordstore`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/passwordstore.py) | Manage passwords with GPG using [`pass`](https://www.passwordstore.org) file structure.
| [`zut.path`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/path.py) | Normalize and check paths, find paths to the root hierarchy, get default application directories.
| [`zut.perf`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/perf.py) | Track elapsed time and memory consumption (requires `zut[perf]` extra: `psutil`).
| [`zut.pip`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/pip.py) | Install PyPi dependencies with `pip`.
| [`zut.process`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/process.py) | Run processes and handle process errors (wrappers and extensions on stdlib's `subprocess`).
| [`zut.secret`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/secret.py) | Define and resolve secrets.
| [`zut.sql`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/sql.py) | Format and parse SQL queries.
| [`zut.tab`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/tab.py) | Provide a polyfill for the `tabulate` function to handle simple cases.
| [`zut.term`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/term.py) | Console ANSI colors and live, interactive Console output.
| [`zut.text`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/text.py) | Manage UTF8 BOM, fix encoding issues, generate slugs, provide flexible filters.
| [`zut.time`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/time.py) | Parse and convert dates, times and time zones.
| [`zut.typing`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/typing.py) | Python typing helpers.
| [`zut.unittest`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/unittest.py) | Test runner wrapper and polyfills for `unittest`.
| [`zut.url`](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/zut/url.py) | Build and manipulate URLs.


## Contribute

Pull requests are welcome.

See [contributing guidelines](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/CONTRIBUTING.md).


## Legal

This project is licensed under the terms of the [MIT license](https://codeberg.org/ipamo/zut/src/tag/v4.1.0/LICENSE.txt).

Logo by [Eric Watson - Dreamstime.com](https://www.dreamstime.com/dreamstime-template-image140091035) (_"Royalty-free vector"_).
