Boilerplate tools for python based projects.
Find a file
2024-08-20 20:17:07 +02:00
src/ktools Refactor CspMedia, release v1.0.4 2024-08-20 20:17:07 +02:00
.gitignore Refactorings 2024-08-19 21:27:13 +02:00
.isort.cfg Initial commit 2023-05-13 19:40:40 +02:00
__init__.py Initial commit 2023-05-13 19:40:40 +02:00
LICENSE Modernizing installation 2024-08-19 19:17:15 +02:00
pyproject.toml Refactorings 2024-08-19 21:27:13 +02:00
README.md Add slugify 2023-05-21 20:05:22 +02:00
setup.py Modernizing installation 2024-08-19 19:17:15 +02:00

Ktools

This module contains boilerplate for python projects, mostly based on django.

Contents

Django

ktools.django.db.models.fields.PositiveAutoField

A mysql-based AutoField that will use an UNSIGNED INT for a primary field.

Use this in django's settings.py:

DEFAULT_AUTO_FIELD = 'ktools.django.db.models.fields.PositiveAutoField'

Cache

ktools.cache.functional.memoized_method

A decorator to cache return values of a method (of a class) until the class is used. Parameters are that of lru_cache() since it uses that function under the hood.

ktools.django.utils.text.slugify

Function to return an ASCII-safe slugified string from any utf-8 string.