core-mixins
This project contains common functions, decorators, and mixin classes as the base for other projects or libraries…
Installation
Install from PyPI using pip:
pip install core-mixins
uv pip install core-mixins # Or using UV...
Features
This library provides the following modules and utilities:
- Compatibility
Self - Type hint for self-referential classes
StrEnum - String enumeration compatibility across Python versions
- Decorators (core_mixins.decorators)
cache / cache_memory_based - In-memory LRU memoization with optional maxsize and ttl
cache_file_based - Write-through two-level cache (L1 memory + L2 disk), survives process restarts
count_calls - Track function call counts
repeat - Execute functions multiple times
retry - Automatic retry with configurable backoff
singleton - Enforce single instance pattern
SyncWrapper - Convert async functions to synchronous
with_timeout - Subprocess-based timeout, cross-platform, sub-second precision
with_timeout_signal - Signal-based timeout (Unix/Linux only), minimal overhead
timer - Measure function execution time
- File Utilities (core_mixins.files)
records_from_csv / records_to_csv - CSV file handling
records_from_buffer / records_to_buffer - In-memory CSV operations
- Interfaces (core_mixins.interfaces)
IFactory - Factory pattern interface
ITask - Task interface with status tracking
TaskStatus - Task state enumeration
TaskException - Task-specific exceptions
- Managers (core_mixins.managers)
TasksManager - Manage and execute multiple tasks
TaskResult - Task execution result container
- Logging (core_mixins.logger)
get_logger - Standardized logger configuration
- Utilities (core_mixins.utils)
random_string - Generate random strings
get_batches - Batch list processing
remove_attributes / rename_attributes / add_attributes - Dictionary manipulation
convert_data_type - Type conversion utilities
to_snake_case - Convert strings to snake_case
flatten_json - Flatten nested JSON structures
to_one_line - Convert multiline strings to single line
bytes_to_str - Convert bytes to string
- Exceptions (core_mixins.exceptions)
get_exception_data - Extract structured exception information
- CLI Utilities (core_mixins.cli)
ProgressTracker - TTY-aware progress bar; animates on real terminals, falls back to logger.info on Lambda/ECS/CI. Built as a zero-dependency alternative to tqdm, keeping core-mixins dependency-free so it does not pull transitive packages into production services where supply-chain surface area and package size matter.
Quick Start
Installation
Install the package:
pip install core-mixins
uv pip install core-mixins # Or using UV...
pip install -e ".[dev]" # For development...
Setting Up Environment
Install required libraries:
pip install --upgrade pip
pip install virtualenv
Create Python virtual environment:
virtualenv --python=python3.12 .venv
Activate the virtual environment:
source .venv/bin/activate
Install packages
pip install .
pip install -e ".[dev]"
Check tests and coverage
python manager.py run-tests # unit tests (default)
python manager.py run-tests -t integration # integration tests
python manager.py run-tests -t functional -p "*.py" # functional tests
python manager.py run-coverage # all tests with coverage
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Write tests for new functionality
Ensure all tests pass: python manager.py run-tests
Run linting: pylint core_mixins
Run security checks: bandit -r core_mixins
Submit a pull request
License
This project is licensed under the MIT License. See the LICENSE file for details.
Links
Support
For questions or support, please open an issue on GitLab or contact the maintainers.
Metadata
Release files for core-mixins 3.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| core_mixins-3.2.3.tar.gz | 24.0 kB | With provenance | Details for core_mixins-3.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| core_mixins-3.2.3-py3-none-any.whl | Python 3 | none | any | Details for core_mixins-3.2.3-py3-none-any.whl |
Total release size: 52.7 kB
Release files / core_mixins-3.2.3.tar.gz
| Download URL | core_mixins-3.2.3.tar.gz |
|---|---|
| Size | 24.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
357997be31d69ed0f3b46a0ac835a91acce841b2aa515038aaae20abe4ea7dfa
|
|
BLAKE2b-256 checksum How to use checksums |
11479fa0e23c7613d6bd36e32de9fc4b6312d08023aea15a15e89230433020e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitLab CI/CD, verified by PyPI on Nov 12, 2026.
Transparency logRelease files / core_mixins-3.2.3-py3-none-any.whl
| Download URL | core_mixins-3.2.3-py3-none-any.whl |
|---|---|
| Size | 28.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
542bc168119c9118c8143c960306001ea524a42597a4bb0e6344746f837ec37a
|
|
BLAKE2b-256 checksum How to use checksums |
48a0264e57a4b5d8f5214b6216045c27a09a332cb4e1eac63a8e016f4c09b02a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitLab CI/CD, verified by PyPI on Nov 12, 2026.
Transparency logSecurity for core-mixins 3.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for core_mixins-3.2.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitLab CI/CD, verified by PyPI on Nov 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.