xocto
raw JSON → 9.0.3 verified Sat May 09 auth: no python
A collection of Python service utilities used by Kraken Technologies, providing helpers for strings, dates, storage, retries, and more. Current version 9.0.3, requires Python >=3.9. Released regularly as part of Kraken's internal tooling.
pip install xocto Common errors
error AttributeError: module 'xocto' has no attribute 'LocalFileStorage' ↓
cause Renamed or removed storage class.
fix
Use from xocto import storage; storage.LocalStorage (or S3Storage, etc.).
error TypeError: set_storage() missing 1 required positional argument: 'backend' ↓
cause set_storage called without a storage backend instance.
fix
Call storage.set_storage(storage.LocalStorage()) with an instance.
Warnings
breaking In version 9.0.0, the storage module's API changed. set_storage must be called before any storage operations, and the storage classes were renamed (e.g., LocalStorage instead of LocalFileStorage). ↓
fix Call storage.set_storage(storage.LocalStorage()) at startup. Update imports from old names.
deprecated The old storage classes (e.g., LocalFileStorage, S3Storage) are deprecated in favour of LocalStorage, S3Storage, etc. without the 'File' prefix. ↓
fix Switch to the new names: LocalStorage, S3Storage, etc.
gotcha If you use xocto.storage without calling set_storage first, all storage operations will fail with an unhelpful error. ↓
fix Always call storage.set_storage(...) at application startup.
Imports
- set_storage
from xocto import storage; storage.set_storage(...) - local_storage
from xocto.storage import local_storage - retry
from xocto import retry; retry.retry(...) - strings
from xocto import strings - dates
from xocto import dates
Quickstart
import os
from xocto import storage, strings, dates
storage.set_storage(storage.LocalStorage())
# Example: generate a slug
title = "Hello World!"
slug = strings.slugify(title)
print(slug) # hello-world
# Example: get current UTC time
now = dates.utc_now()
print(now)