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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27889d087a0a61ce202a00cea99ea11741d5334960991949fdd93b3b492179a2
|
|
| MD5 |
42e28ca3ba0b56077d6e1b24e43868d2
|
|
| BLAKE2b-256 |
12bdcbe5225d667c1fa0fd681b3e38813f874e5adf2d943dfca574103d10c6ee
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tks_essentials-0.1.37.tar.gz -
Subject digest:
27889d087a0a61ce202a00cea99ea11741d5334960991949fdd93b3b492179a2 - Sigstore transparency entry: 1079794505
- Sigstore integration time:
-
Permalink:
The-Kara-System/tks-essentials@884a10b28b717d158d7e09c675dc0414b49cba2f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/The-Kara-System
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
testing_and_deployment.yml@884a10b28b717d158d7e09c675dc0414b49cba2f -
Trigger Event:
push
-
Statement type:
File details
Details for the file tks_essentials-0.1.37-py3-none-any.whl.
File metadata
- Download URL: tks_essentials-0.1.37-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e52f9541b9c950edfe87b2dc97b32a6eece810648d8d4f1eb0cecc6ac76906ee
|
|
| MD5 |
9cc603673b090c0bc2f332361c12e4cb
|
|
| BLAKE2b-256 |
9b70f7b933f0da4318061fce41959fc3ee1cff51a2c802d7f52c636af8b33710
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tks_essentials-0.1.37-py3-none-any.whl -
Subject digest:
e52f9541b9c950edfe87b2dc97b32a6eece810648d8d4f1eb0cecc6ac76906ee - Sigstore transparency entry: 1079794589
- Sigstore integration time:
-
Permalink:
The-Kara-System/tks-essentials@884a10b28b717d158d7e09c675dc0414b49cba2f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/The-Kara-System
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
testing_and_deployment.yml@884a10b28b717d158d7e09c675dc0414b49cba2f -
Trigger Event:
push
-
Statement type: