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.38.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.38-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tks_essentials-0.1.38.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.38.tar.gz
Algorithm Hash digest
SHA256 cf47dd20e63d8db49b43f51c76fd8b7c6f170ecae3ab271c7a82e7bbad5f2d1f
MD5 478ee04dd98eaff79ebb51c39389c975
BLAKE2b-256 756d15bc47a702849176a3ee3ff463b338244dfb348148f271b0dbdc35df24cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for tks_essentials-0.1.38.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.38-py3-none-any.whl.

File metadata

File hashes

Hashes for tks_essentials-0.1.38-py3-none-any.whl
Algorithm Hash digest
SHA256 0957a7c8eaf439615fbf6cc735e46134eb44faa43dbae4ba91bbaba971e6315a
MD5 a9fb182cec719308e6f07ffc7e2d32d3
BLAKE2b-256 b9a6642ddafdb9ba93fbb15d496862ee490f8cc0bbde3dd1fa079841494f7757

See more details on using hashes here.

Provenance

The following attestation bundles were made for tks_essentials-0.1.38-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