Skip to main content

Reusable Python, Django and PostgreSql utilities.

Project description

Zut

Reusable Python, Django and PostgreSql utilities.

Install

From PyPI:

pip install zut

From Git, last version:

pip install git+https://gitlab.com/ipamo/zut.git@main

Use SSH instead of HTTPS url:

pip install git+ssh://git@gitlab.com/ipamo/zut.git@main

Specific version, including extra dependencies:

pip install git+https://gitlab.com/ipamo/zut.git@v0.3.1#egg=zut[extra]

In a requirements.txt file, including extra dependencies:

zut[extra] @ git+https://gitlab.com/ipamo/zut.git@v0.3.1#egg=zut[extra]

Dev quick start

Install Python, its packet manager (pip) and PostgreSql. Under Linux, also install password manager pass (used as credentials manager).

Windows pre-requisites:

  • Download Python and install it.
  • Download PostgreSql, install it, and add binaries (C:\Program Files\PostgreSQL\14\bin) to PATH.

Linux (Debian) pre-requisites:

sudo apt install python3-venv python3-pip postgresql pass

Create Python virtual environment (example for Windows):

python -m venv .venv      # Debian: python3 -m venv .venv
.\.venv\Scripts\activate  # Linux: source .venv/bin/activate
pip install .[all,dev]

Create test database (cf. parameters in tests/settings.py). Example:

sudo -u postgres psql -c "create database test_zut encoding 'utf8' template 'template0'"

For Linux, configure password manager pass. Example:

# Import your GPG key, show key identifier and mark key as trusted
gpg --import my-private-gpg-key.asc
gpg --list-secret-keys
gpg --edit-key mykey@example.org
trust
5
o
q

# Initialize "pass" with your GPG key
pass init mykey@example.org

Run tests:

python -m unittest

Run commands :

python -m zut --help

Publish library

Configure ~/.pypirc (see example).

Build and upload distribution:

# $env:HTTPS_PROXY="..."                         # if necessary
# $env:TWINE_CERT="C:\...\ca-certificates.crt"   # if necessary
python tools.py build --upload

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

zut-0.4.2-py3-none-any.whl (32.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page