Skip to content

Install the CLI and the client

Python CLI

pip install loconym
uv tool install loconym

The dependencies are on conda-forge. Install them, then the CLI:

pixi init my-project && cd my-project
pixi add python pyosmium shapely apsw osmium-tool
pixi add --pypi loconym

The CLI needs Python 3.11 or newer. It depends on pyosmium (PyPI name osmium), Shapely and APSW. All three ship binary wheels for Linux, macOS and Windows.

Check the install:

loconym --help

Optional: osmium-tool

For extracts larger than about 400 MiB, the builder can pre-filter the input with the osmium-tool osmium binary to keep memory bounded (see Build a database from a large extract). It is not on PyPI. Install it with your system package manager or conda:

conda install -c conda-forge osmium-tool   # or: apt install osmium-tool / brew install osmium-tool

TypeScript client

npm install loconym     # or: pnpm add loconym / yarn add loconym

The package is ESM-only and ships its own type declarations.

Bundler setup

The client loads SQLite's WebAssembly build at runtime. With Vite, exclude the SQLite packages from dependency pre-bundling:

vite.config.ts
import { defineConfig } from 'vite';

export default defineConfig({
  optimizeDeps: { exclude: ['@sqlite.org/sqlite-wasm', 'sqlite-wasm-http'] },
  worker: { format: 'es' },
});

To use range mode, the page must also be cross-origin isolated. That guide shows the extra Vite settings.