Skip to main content

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: lacus_utils-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 476a10d8c9f5113c4a17d9c069a4c617e91d5554ace5addfa95159a8a0edec85
MD5 6a254445fba0b6d43768e2c4f5c438a8
BLAKE2b-256 b6c1907e81dc94aec1b97ce1efb66a7f384b36d33affcbcd647f30e4a83e6220

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lacus_utils-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c6849c5432d23feef572378c2bf3efc7eed56532df4646baa57c9d7faff417a2
MD5 b1b6ec4768bd25a453582f5537803da0
BLAKE2b-256 a865b55fd360e017cbf65194e584608a85fb1a6eb31b4ee700072e482e2f4405

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page