pycoretools
pycoretools is a lightweight collection of generic, low-level utilities that are reused across multiple Python projects.
It is designed to provide commonly needed building blocks without introducing heavy dependencies or project-specific assumptions.
This package exists primarily to break dependency cycles between higher-level libraries and to centralise small but widely useful tools.
Provided utilities
Concurrency helpers
mapThreads: a flexiblemap-like interface supporting- multiprocessing or threading
- nested parallelism
- progress reporting
- optional checkpointing via pickled caches
filterThreads: parallelised filtering built on top ofmapThreads
These helpers are designed to work robustly in complex environments (e.g. nested pools, daemonic processes).
Context management
TemporarySetting: temporarily override a module attribute or namespace entry, e.g.
import syngular
from pycoretools import TemporarySetting
with TemporarySetting(syngular, "TIMEOUT", 3600):
...
Useful for safely modifying global or module-level settings locally.
Decorators
retry: retry a function call on specified exceptionswith_cm: apply a context manager as a decorator
Iterable utilities
flatten: controlled flattening of nested iterables, with support for- list subclasses
- NumPy arrays
- SymPy matrices
- limited recursion depth
crease: inverse operation to flatten, reconstructing nested structure from a templatechunks: iterate over fixed-size chunksall_non_empty_subsets: generate all non-empty subsets of an iterable
Sentinels
NaI(“Not an Integer”): a singleton sentinel value that propagates through arithmetic operations, akin to NaN (“Not a Number“) for foats.
from pycoretools import NaI
NaI + 3 # NaI
NaI * 10 # NaI
Installation
The package is available on the Python Package Index:
pip install pycoretools
For development:
git clone https://github.com/GDeLaurentis/pycoretools.git
pip install -e pycoretools
Requirements
pycoretools itself depends only on the Python standard library.
Optional behaviour in some utilities may interact with:
numpysympy
These are not required dependencies.
Metadata
Release files for pycoretools 0.1.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 | Provenance | Actions |
|---|---|---|---|---|
| pycoretools-0.1.1.tar.gz | 25.3 kB | Without provenance | Details for pycoretools-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pycoretools-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for pycoretools-0.1.1-py3-none-any.whl |
Total release size: 48.3 kB
Release files / pycoretools-0.1.1.tar.gz
| Download URL | pycoretools-0.1.1.tar.gz |
|---|---|
| Size | 25.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8eba0bc38b1feac6e01c00a4cf194963e6cdc3161939ca402e37dbcc29b9c2c
|
|
BLAKE2b-256 checksum How to use checksums |
8da7b0d76bea35ae52b9821c720dbd25e4fa21d6ceb573fc7020ac3bd68250d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.3
|
Release files / pycoretools-0.1.1-py3-none-any.whl
| Download URL | pycoretools-0.1.1-py3-none-any.whl |
|---|---|
| Size | 23.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
356644775a3539119e57658ad490762cf26e03eeeb7ede43187a30b6f5fab281
|
|
BLAKE2b-256 checksum How to use checksums |
4bf23f74503dc8d334c0fdd780317955d2347bd8c4456e9ed8859c7eb6d28872
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.3
|
Security for pycoretools 0.1.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.