Lacus Solutions' Utils
Reusable utilities library for Lacus Solutions' Python packages.
Python Support
| 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': digits0-9'alphabetic': uppercase lettersA-Z'alphanumeric': digits and uppercase letters0-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:
- Starring the repository
- Contributing to the codebase
- Suggesting new features
- Reporting bugs
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
Metadata
Release files for lacus.utils 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lacus_utils-1.0.1.tar.gz | 5.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lacus_utils-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.3 kB
Release files / lacus_utils-1.0.1.tar.gz
| Download URL | lacus_utils-1.0.1.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
476a10d8c9f5113c4a17d9c069a4c617e91d5554ace5addfa95159a8a0edec85
|
|
BLAKE2b-256 checksum How to use checksums |
b6c1907e81dc94aec1b97ce1efb66a7f384b36d33affcbcd647f30e4a83e6220
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / lacus_utils-1.0.1-py3-none-any.whl
| Download URL | lacus_utils-1.0.1-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6849c5432d23feef572378c2bf3efc7eed56532df4646baa57c9d7faff417a2
|
|
BLAKE2b-256 checksum How to use checksums |
a865b55fd360e017cbf65194e584608a85fb1a6eb31b4ee700072e482e2f4405
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|