Skip to main content

Essentials for our TKS projects.

Project description

tks-essentials

A library with essentials needed in every backend Python app, including logging, local database connection helpers, filtering, and formatting utilities.

Sponsors

Freya Alpha, The Kára System, Spark & Hale Robotic Industries

Requirements

This package currently requires Python 3.12.9 or newer.

Installation

Install from PyPI:

python -m pip install tks-essentials

Import the package without the dash:

from tksessentials import global_logger

Development

Setup as Contributor

Create the virtual environment:

py -m venv .venv

Activate it in PowerShell:

.\.venv\Scripts\Activate.ps1

Install runtime dependencies:

python -m pip install -r .\requirements.txt

Install dev dependencies:

python -m pip install -r .\requirements-dev.txt

requirements-dev.txt already includes requirements.txt, so the dev file alone is enough for local development and testing.

To clean up the environment:

pip3 freeze > to-uninstall.txt
pip3 uninstall -y -r to-uninstall.txt

Testing

Before running tests, make sure utils.py can find the project root. Either set the PROJECT_ROOT environment variable to the repository root, or create a config or logs directory there.

Run the unit suite:

python -m pytest

Integration tests live in tests/int. They automatically start the Docker Compose stack in tests/docker-compose.yaml, wait for a 3-broker Kafka cluster plus ksqlDB to become ready, and tear the stack down when the test session ends.

Run the integration suite:

python -m pytest tests/int

If you want unit-test coverage locally:

python -m pytest --cov=tksessentials --cov-report=term-missing --cov-report=html --cov-fail-under=80

Build Library

This repository is built from pyproject.toml. There is no setup.py, so python setup.py bdist_wheel is not the correct build command anymore.

Install the build frontend:

python -m pip install build

Build source and wheel distributions:

python -m build

Artifacts are written to dist/.

Validate the generated packages in PowerShell:

$dist = Get-ChildItem .\dist | ForEach-Object { $_.FullName }
python -m twine check $dist

Releasing a New Version / CI/CD Process

GitHub Actions runs the release flow. The workflow installs .[dev], builds with python -m build, validates the distributions, and publishes them to PyPI.

Project details


Download files

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

Source Distribution

tks_essentials-0.1.37.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tks_essentials-0.1.37-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file tks_essentials-0.1.37.tar.gz.

File metadata

  • Download URL: tks_essentials-0.1.37.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tks_essentials-0.1.37.tar.gz
Algorithm Hash digest
SHA256 27889d087a0a61ce202a00cea99ea11741d5334960991949fdd93b3b492179a2
MD5 42e28ca3ba0b56077d6e1b24e43868d2
BLAKE2b-256 12bdcbe5225d667c1fa0fd681b3e38813f874e5adf2d943dfca574103d10c6ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for tks_essentials-0.1.37.tar.gz:

Publisher: testing_and_deployment.yml on The-Kara-System/tks-essentials

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tks_essentials-0.1.37-py3-none-any.whl.

File metadata

File hashes

Hashes for tks_essentials-0.1.37-py3-none-any.whl
Algorithm Hash digest
SHA256 e52f9541b9c950edfe87b2dc97b32a6eece810648d8d4f1eb0cecc6ac76906ee
MD5 9cc603673b090c0bc2f332361c12e4cb
BLAKE2b-256 9b70f7b933f0da4318061fce41959fc3ee1cff51a2c802d7f52c636af8b33710

See more details on using hashes here.

Provenance

The following attestation bundles were made for tks_essentials-0.1.37-py3-none-any.whl:

Publisher: testing_and_deployment.yml on The-Kara-System/tks-essentials

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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