ocdkit
A toolkit for array manipulation, GPU dispatch, image I/O, spatial operations, morphology, and plotting.
Install
pip install ocdkit # core (numpy, scipy, scikit-image, tifffile, matplotlib)
pip install ocdkit[torch] # + PyTorch GPU support
pip install ocdkit[plot] # + ncolor, cmap, opt_einsum
pip install ocdkit[spatial] # + numba, fastremap (contour extraction, skeletonization)
pip install ocdkit[all] # everything
Modules
| Module | What's in it |
|---|---|
ocdkit.array |
rescale, safe_divide, is_integer, get_module, unique_nonzero |
ocdkit.gpu |
resolve_device, empty_cache, torch_GPU, torch_CPU |
ocdkit.io |
imread, imwrite, getname, check_dir |
ocdkit.spatial |
kernel_setup, get_neighbors, get_neigh_inds, masks_to_affinity, get_contour, boundary_to_masks |
ocdkit.morphology |
find_boundaries, skeletonize |
ocdkit.measure |
crop_bbox, bbox_to_slice, make_square, diameters |
ocdkit.plot |
figure, image_grid, split_list, colorize, rgb_flow, vector_contours, apply_ncolor, color_swatches, recolor_label, add_label_background |
Quick start
from ocdkit.array import rescale
from ocdkit.gpu import resolve_device
from ocdkit.plot import figure, image_grid
device = resolve_device() # auto-detect CUDA / MPS / CPU
Performance tips
Pin numba's JIT cache to local disk
If your project source lives on a network filesystem (SMB / NFS), set
NUMBA_CACHE_DIR to a local-disk location. By default numba writes its
JIT cache to __pycache__ next to the source file, which on a
NAS-mounted tree means dozens of small SMB ops per fresh subprocess —
several seconds of overhead on every cold import.
ocdkit auto-applies $HOME/.cache/numba as the default if you haven't
set it (see src/ocdkit/__init__.py), but for shells, test runners, and
non-ocdkit code, set it explicitly:
# Linux / macOS — add to ~/.zshrc, ~/.bashrc, or ~/.profile
export NUMBA_CACHE_DIR="$HOME/.cache/numba"
# Windows — add to $PROFILE
[Environment]::SetEnvironmentVariable('NUMBA_CACHE_DIR', "$env:USERPROFILE\.cache\numba", 'User')
Compiled artifacts are machine-local anyway (CPU- and Python-version specific), so they don't belong on shared NAS regardless of perf.
License
BSD-3-Clause
Metadata
Release files for ocdkit 0.0.8
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 |
|---|---|---|---|---|
| ocdkit-0.0.8.tar.gz | 1.1 MB | Without provenance | Details for ocdkit-0.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ocdkit-0.0.8-py3-none-any.whl | Python 3 | none | any | Details for ocdkit-0.0.8-py3-none-any.whl |
Total release size: 2.1 MB
Release files / ocdkit-0.0.8.tar.gz
| Download URL | ocdkit-0.0.8.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05d1973c3a842d889b271fb2a6fc2e4438652381432e9111351585a4c82dad78
|
|
BLAKE2b-256 checksum How to use checksums |
bf87c4d9dd56bbe2ed6ea2a3fe090e0483d32fca6a5410b863e99803e0014602
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|
Release files / ocdkit-0.0.8-py3-none-any.whl
| Download URL | ocdkit-0.0.8-py3-none-any.whl |
|---|---|
| Size | 1.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a918692096eefe52620f414c064a41f5194e734434d6b99e38205ddb04f0d68
|
|
BLAKE2b-256 checksum How to use checksums |
7ffbe7a7a94b26fdd4a8f3434ca2890b4037bae2a814b428567519597d356d47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|
Security for ocdkit 0.0.8
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.