Installation

APbase is distributed with compiled numerical extensions. Install the package for your language.

Requirements

  • CPython 3.12, 3.13, or 3.14
  • numpy (2.0+), pyproj, shapely (installed automatically as dependencies)
  • Prebuilt wheels for Linux on x86_64 (glibc 2.28+), macOS on arm64 (14+) and x86_64 (15+), and Windows on x86_64. No source distribution is published, so other platforms and Python versions cannot install the package.

Install

pip install apbase

To install the development version from the repository instead:

pip install git+https://github.com/ap-base/apbase-python.git

Optional extras

The targets argument of IDW, Kriging, and CoKriging also accepts a GeoDataFrame or GeoSeries of points when geopandas is installed. You can skip this extra when passing plain NumPy arrays:

pip install geopandas

Verify the install

Build a tiny map to confirm the native kernels load and run:

import numpy as np

import apbase

rng = np.random.default_rng(0)
x, y = rng.uniform(0, 100, 50), rng.uniform(0, 100, 50)
result = apbase.create_map(x, y, x + y, resolution=10.0)
print(result.method, result.z.size)

Using it in production

See Production and cloud deployment for thread configuration and worker sizing.

A Rust service built with cargo build --release links the native kernels statically, but the runtime image still needs the shared libraries they depend on: the Fortran, OpenMP, and BLAS runtime (libgfortran5, libgomp1, and libopenblas0 on Debian/Ubuntu), the GEOS C library (libgeos-c1t64 on Ubuntu 24.04), and PROJ when it was linked from the system. A PROJ built from source is linked statically and needs only libsqlite3-0 at run time.