scikitplot.cython#

A lightweight runtime Cython development kit with caching, pinning, garbage collection, and templating support.

scikitplot.cython enables real-time, in-place (in-situ) generation of low-level Cython packages and modules for immediate use and testing.

User guide. See the Cython Realtime Inplace PKG/MOD Generation section for further details.

Cython Realtime Inplace PKG/MOD Generation#

compile_and_load

Compile and import a Cython extension module and return the loaded module.

compile_and_load_result

Compile and import a Cython extension module from source text.

cython_import

Compile/import a Cython module from a .pyx file and return the loaded module.

cython_import_result

Compile/import a Cython module from a .pyx file.

cython_import_all

Compile and import all .pyx files in a directory.

build_package_from_code

Build and import a multi-module extension package and return loaded modules.

build_package_from_code_result

Build and import a multi-module extension package from code strings.

build_package_from_paths

Build and import a multi-module extension package and return loaded modules.

build_package_from_paths_result

Build and import a multi-module extension package from .pyx file paths.

import_cached

Import a cached module entry and return the loaded module.

import_cached_result

Import a cached module entry by cache key.

import_cached_by_name

Import the newest cached module entry matching module_name.

import_cached_package

Import a cached package and return the loaded modules.

import_cached_package_result

Import a cached package entry by cache key.

register_cached_artifact_path

Register an existing compiled extension artifact on disk, then import it.

register_cached_artifact_bytes

Register a compiled extension artifact from bytes and import it.

import_artifact_path

Import a compiled extension artifact from a path.

import_artifact_bytes

Import a compiled extension artifact from raw bytes.

export_cached

Export a cache entry directory to a destination folder.

Cache management#

get_cache_dir

Resolve (and create) the cache root directory.

list_cached

List cached module entries.

list_cached_packages

List cached package entries.

cache_stats

Return cache statistics for the given cache root.

gc_cache

Garbage-collect cached builds deterministically.

purge_cache

Delete the entire cache directory.

Pins/aliases#

pin

Pin a cache key under a human-friendly alias.

unpin

Remove a pinned alias.

list_pins

List alias→key mappings in the pin registry.

import_pinned

Import a pinned alias and return the loaded module(s).

import_pinned_result

Import a pinned alias.

Prereqs#

check_build_prereqs

Check whether build prerequisites are importable.

Results#

BuildResult

Result of compiling/importing a single Cython extension module.

PackageBuildResult

Result of compiling/importing a package of extension modules.

CacheStats

Cache statistics for the compiled-artifact cache root.

CacheGCResult

Result of a cache garbage-collection operation.

CacheEntry

A compiled module cache entry.

PackageCacheEntry

A compiled package cache entry (multi-module build).

Templates / workflows#

TemplateInfo

Structured metadata for a template.

template_root

Return the on-disk template root directory.

list_templates

List available templates.

get_template_path

Resolve a template ID to an on-disk path.

read_template

Read template source text.

read_template_info

Read metadata for a template and return a TemplateInfo.

load_template_metadata

Load template metadata from an adjacent *.meta.json file.

compile_template

Compile and import a Cython template and return the loaded module.

compile_template_result

Compile and import a Cython template and return a structured result.

list_package_examples

List available multi-module package examples.

get_package_example_path

Resolve a package example name to its on-disk folder path.

load_package_example_metadata

Load package example metadata from package.meta.json.

build_package_example_result

Build and import a multi-module package example and return a structured result.

build_package_example

Build and import a multi-module package example and return loaded modules.

list_workflows

List available workflow template folders.

get_workflow_path

Resolve a workflow name to its on-disk folder path.

workflow_cli_template_path

Return the workflow CLI template path.

copy_workflow

Copy a workflow template folder to a destination directory.

generate_sphinx_template_docs

Generate Sphinx .rst pages listing templates and their usage.