Metadata-Version: 2.4
Name: zut
Version: 3.1.0
Summary: Reusable Python utilities.
Author-email: Sébastien Hocquet <seb@ipamo.net>
Project-URL: Homepage, https://gitlab.com/ipamo/zut
Project-URL: Bug Tracker, https://gitlab.com/ipamo/zut/issues
Keywords: reusable,util,utils,common,commons,base,csv,excel,etl,db,database,load,bulk,insert,merge,upsert,sqlite,postgresql,pg,mysql,maria,mariadb,sqlserver,mssql
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
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: smb
Requires-Dist: smbprotocol; extra == "smb"
Provides-Extra: s3
Requires-Dist: boto3; extra == "s3"
Provides-Extra: zip
Requires-Dist: zipp>=3.2.0; python_version < "3.10" and extra == "zip"
Provides-Extra: pg
Requires-Dist: psycopg[binary]; extra == "pg"
Requires-Dist: sqlparse; extra == "pg"
Requires-Dist: tzlocal; (python_version < "3.9" or sys_platform == "win32") and extra == "pg"
Requires-Dist: pytz; python_version < "3.9" and extra == "pg"
Requires-Dist: tzdata; (python_version >= "3.9" and sys_platform == "win32") and extra == "pg"
Provides-Extra: postgresql
Requires-Dist: psycopg[binary]; extra == "postgresql"
Requires-Dist: sqlparse; extra == "postgresql"
Requires-Dist: tzlocal; (python_version < "3.9" or sys_platform == "win32") and extra == "postgresql"
Requires-Dist: pytz; python_version < "3.9" and extra == "postgresql"
Requires-Dist: tzdata; (python_version >= "3.9" and sys_platform == "win32") and extra == "postgresql"
Provides-Extra: mysql
Requires-Dist: mysqlclient; extra == "mysql"
Requires-Dist: sqlparse; extra == "mysql"
Requires-Dist: tzlocal; (python_version < "3.9" or sys_platform == "win32") and extra == "mysql"
Requires-Dist: pytz; python_version < "3.9" and extra == "mysql"
Requires-Dist: tzdata; (python_version >= "3.9" and sys_platform == "win32") and extra == "mysql"
Provides-Extra: mariadb
Requires-Dist: mysqlclient; extra == "mariadb"
Requires-Dist: sqlparse; extra == "mariadb"
Requires-Dist: tzlocal; (python_version < "3.9" or sys_platform == "win32") and extra == "mariadb"
Requires-Dist: pytz; python_version < "3.9" and extra == "mariadb"
Requires-Dist: tzdata; (python_version >= "3.9" and sys_platform == "win32") and extra == "mariadb"
Provides-Extra: sqlserver
Requires-Dist: pyodbc; extra == "sqlserver"
Requires-Dist: sqlparams; extra == "sqlserver"
Requires-Dist: sqlparse; extra == "sqlserver"
Requires-Dist: tzlocal; (python_version < "3.9" or sys_platform == "win32") and extra == "sqlserver"
Requires-Dist: pytz; python_version < "3.9" and extra == "sqlserver"
Requires-Dist: tzdata; (python_version >= "3.9" and sys_platform == "win32") and extra == "sqlserver"
Provides-Extra: mssql
Requires-Dist: pyodbc; extra == "mssql"
Requires-Dist: sqlparams; extra == "mssql"
Requires-Dist: sqlparse; extra == "mssql"
Requires-Dist: tzlocal; (python_version < "3.9" or sys_platform == "win32") and extra == "mssql"
Requires-Dist: pytz; python_version < "3.9" and extra == "mssql"
Requires-Dist: tzdata; (python_version >= "3.9" and sys_platform == "win32") and extra == "mssql"
Provides-Extra: sqlite
Requires-Dist: sqlparse; extra == "sqlite"
Requires-Dist: tzlocal; (python_version < "3.9" or sys_platform == "win32") and extra == "sqlite"
Requires-Dist: pytz; python_version < "3.9" and extra == "sqlite"
Requires-Dist: tzdata; (python_version >= "3.9" and sys_platform == "win32") and extra == "sqlite"
Provides-Extra: tz
Requires-Dist: tzlocal; (python_version < "3.9" or sys_platform == "win32") and extra == "tz"
Requires-Dist: pytz; python_version < "3.9" and extra == "tz"
Requires-Dist: tzdata; (python_version >= "3.9" and sys_platform == "win32") and extra == "tz"
Provides-Extra: tabulate
Requires-Dist: tabulate; extra == "tabulate"
Provides-Extra: excel
Requires-Dist: openpyxl; extra == "excel"
Requires-Dist: defusedxml; extra == "excel"
Provides-Extra: django
Requires-Dist: django; extra == "django"
Provides-Extra: perf
Requires-Dist: psutil; extra == "perf"
Provides-Extra: all
Requires-Dist: smbprotocol; extra == "all"
Requires-Dist: boto3; extra == "all"
Requires-Dist: zipp>=3.2.0; python_version < "3.10" and extra == "all"
Requires-Dist: psycopg[binary]; extra == "all"
Requires-Dist: mysqlclient; extra == "all"
Requires-Dist: pyodbc; extra == "all"
Requires-Dist: sqlparams; extra == "all"
Requires-Dist: sqlparse; 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: tabulate; extra == "all"
Requires-Dist: openpyxl; extra == "all"
Requires-Dist: defusedxml; extra == "all"
Requires-Dist: django; extra == "all"
Requires-Dist: psutil; extra == "all"
Dynamic: license-file

Zut
===

Reusable Python utilities.


## Installation

Zut package is published [on PyPI](https://pypi.org/project/zut/). It requires Python version >= 3.7.

Install without any dependency (no dependency is mandatory):

```sh
pip install zut
```

It is also possible to install with an _extra_ specifier to add optional dependencies, for example:

```sh
pip install zut[pg]
```

## Avalable _extra_ specifiers

Please note that no dependency is mandatory to use Zut, if you don't need any of the features below.

### File backends

For `zut.files` package:

- `pip install zut[smb]`: access to Samba/Windows shares (installs `smbprotocol`).
- `pip install zut[s3]`: access to S3 buckets (installs `boto3`).
- `pip install zut[zip]`: access to Zip archives (installs `zipp`, necessary only for Python < 3.10 to mitigate [a bug in the standard library](https://bugs.python.org/issue40564)).

### Database backends

For `zut.db` package:

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

The `tz` extra specifier (see below) is automatically included with all database extra specifiers.

### Miscellaneous features

- `pip install zut[tz]` : parse timezones from string, get local timezone name or convert between naive and aware datetimes in various timezones (installs `tzdata` and `tzlocal` on Windows). This extra specifier does not install anything on Linux (for Python >= 3.9) because this feature is natively available.
- `pip install zut[tabulate]` : 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[excel]` : manage Excel files with `zut.excel` module (installs `openpyxl` and `defusedxml`).
- `pip install zut[django]` : Django utilities available in `zut.django` package (installs `django`).
- `pip install zut[perf]` : track memory performance using `zut.perf` package (installs `psutil`).


## Features

See [full documentation](https://ipamo.net/zut) (including [API reference](https://ipamo.net/zut/latest/api-reference.html)).


## Contribute

Pull requests are welcome.

See [contributing guidelines](https://gitlab.com/ipamo/zut/-/blob/main/CONTRIBUTING.md).


## Credits

This project is licensed under the terms of the [MIT license](https://gitlab.com/ipamo/zut/-/raw/main/LICENSE.txt).

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