Skip to main content

Reusable utilities for Lacus Solutions Python packages

Project description

Lacus Solutions' Utils

PyPI Version PyPI Downloads Python Version Test Status Last Update Date Project License

Reusable utilities library for Lacus Solutions' Python packages.

Python Support

Python 3.10 Python 3.11 Python 3.12 Python 3.13 Python 3.14
Passing ✔ Passing ✔ Passing ✔ Passing ✔ Passing ✔

Features

  • Type description: Python-native type labels for error messages (NoneType, dict, tuple, built-ins, lists)
  • Random sequences: Generate numeric, alphabetic, or alphanumeric sequences of any length
  • Zero dependencies: No external runtime packages required

Installation

$ pip install lacus.utils

Import

from lacus.utils import describe_type, generate_random_sequence, SequenceType

Quick Start

describe_type(None)           # 'NoneType'
describe_type("hello")        # 'string'
describe_type(42)             # 'integer number'
describe_type(3.14)           # 'float number'
describe_type(float("nan"))   # 'NaN'
describe_type({})             # 'dict'
describe_type([1, 2, 3])      # 'number[]'
describe_type([1, "a", 2])    # '(number | string)[]'
describe_type((1, 2))         # 'number tuple'

generate_random_sequence(10, "numeric")       # e.g. '9956000611'
generate_random_sequence(6, "alphabetic")   # e.g. 'AXQMZB'
generate_random_sequence(8, "alphanumeric") # e.g. '8ZFB2K09'

API

All functions are implemented in src/lacus/utils/ and covered by tests in tests/.

describe_type(value) -> str

Describes the type of a value for error messages.

Input Result
None 'NoneType'
str 'string'
bool 'boolean'
int 'integer number'
float (finite) 'float number'
float('nan') 'NaN'
float('inf') / float('-inf') 'Infinity'
complex 'complex number'
dict 'dict'
set / frozenset 'set' / 'frozenset'
bytes / bytearray 'bytes' / 'bytearray'
callable 'function'
class (int, str, …) 'type'
custom class instance 'object'
[] 'Array (empty)'
[1, 2, 3] 'number[]'
[1, 'a', 2] `'(number
() 'tuple (empty)'
(1, 2) 'number tuple'

generate_random_sequence(size: int, sequence_type: SequenceType) -> str

Generates a random character sequence of the given length and type.

  • size: Length of the sequence (e.g. 10).
  • sequence_type: One of:
    • 'numeric': digits 0-9
    • 'alphabetic': uppercase letters A-Z
    • 'alphanumeric': digits and uppercase letters 0-9A-Z

Exports summary

Export Description
describe_type Type description for error messages
generate_random_sequence Random sequence generation
SequenceType Literal type: 'alphabetic' | 'alphanumeric' | 'numeric'

Contribution & Support

We welcome contributions! Please see our Contributing Guidelines for details. If you find this project helpful, please consider:

License

This project is licensed under the MIT License - see the LICENSE file for details.

Changelog

See CHANGELOG for a list of changes and version history.


Made with ❤️ by Lacus Solutions

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

lacus_utils-1.0.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

lacus_utils-1.0.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file lacus_utils-1.0.0.tar.gz.

File metadata

  • Download URL: lacus_utils-1.0.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for lacus_utils-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1b618bdc4b8ea10bc35e1403dc2ec683586b0057ea1d0f1b9e705a7e4360c08f
MD5 f01dbfdc10e0a758471df4c8b74f8866
BLAKE2b-256 053cfc93d97d80f1e8c53c17c126a0686db166a43a7b1a6d6c8f47a624f87d05

See more details on using hashes here.

File details

Details for the file lacus_utils-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: lacus_utils-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for lacus_utils-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d902d692e89b4af7a941f9daffb88ba5a87298dcd0a5eb6652bc7a66cd47ef18
MD5 3795e18cf37b8189cdce201980d20a8c
BLAKE2b-256 2ea8c33e57769dd57cbe2acd363f861756f85ae4908cefc92fa07c101a4122b6

See more details on using hashes here.

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