Skip to main content

maxminddb-polars

Fast Polars expressions for MaxMind DB lookups, implemented in Rust.

The Python API follows Semantic Versioning beginning with 0.1.0. The similarly named crates.io package is the native implementation used to build the Python plugin; it does not currently expose a supported Rust API.

The package provides nested whole-record lookups for recognized MaxMind DB schemas and selective path lookups for efficient enrichment. Callers supply their own licensed or GeoLite database; no database is bundled or downloaded.

Install it from PyPI with:

python -m pip install maxminddb-polars
from pathlib import Path

import polars as pl
import maxminddb_polars as mmp

database = Path("/data/GeoLite2-City.mmdb")
frame = pl.DataFrame({"ip": ["81.2.69.142", None]})

result = frame.select(
    country=mmp.lookup_path("ip", database, ("country", "iso_code")),
    city=mmp.lookup("ip", database),
)

# The expression namespace is equivalent:
country = pl.col("ip").mmdb.lookup_path(database, ("country", "iso_code"))

Whole records infer one of the nine standard schemas from database metadata: City, Country, Enterprise, ISP, Connection Type, Anonymous IP, Density/Income, Domain, or ASN. Their stable Polars dtypes are exported from maxminddb_polars.schemas.

Pass a nested mapping or pl.Struct as dtype for a partial known record or a custom database. See Custom and partial schemas.

Inputs must have String dtype. Null inputs, lookup misses, and missing paths produce null. Invalid IP strings raise by default; pass strict=False to turn them into nulls. The package owns a strong byte snapshot for each database file generation, so atomically replace database files and construct new expressions to refresh them.

Development

Initialize the fixtures and run the checks with:

git submodule update --init --recursive
uv sync --all-extras --locked
uv run maturin develop
uv run pytest
cargo test --locked

See CONTRIBUTING.md for the complete development workflow.

Documentation:

Project policies

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maxminddb_polars-0.1.2.tar.gz (154.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

maxminddb_polars-0.1.2-cp310-abi3-win_amd64.whl (6.5 MB view details)

Uploaded CPython 3.10+Windows x86-64

maxminddb_polars-0.1.2-cp310-abi3-musllinux_1_2_x86_64.whl (7.2 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

maxminddb_polars-0.1.2-cp310-abi3-musllinux_1_2_aarch64.whl (6.7 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

maxminddb_polars-0.1.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

maxminddb_polars-0.1.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

maxminddb_polars-0.1.2-cp310-abi3-macosx_11_0_arm64.whl (6.0 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

maxminddb_polars-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl (6.4 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file maxminddb_polars-0.1.2.tar.gz.

File metadata

  • Download URL: maxminddb_polars-0.1.2.tar.gz
  • Upload date:
  • Size: 154.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for maxminddb_polars-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c4e0e13d3bb371b93c355cd727620187f686ea24ce80026f653b3fed05a0e47c
MD5 4ac4b503c68b58aaad89ae2c6d40a635
BLAKE2b-256 3e73dd78f2ac4bfcb9f64ae2d951fa23f2ae879c6b0a09e81267ce6193cbdae9

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxminddb_polars-0.1.2.tar.gz:

Publisher: release.yml on oschwald/maxminddb-polars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file maxminddb_polars-0.1.2-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for maxminddb_polars-0.1.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 eb714de3bd0549f63a091c9ac7ce2f92f21b84f4a701475c0a46f53c9e9e5435
MD5 283bd6f5301e6e9d21ad0baed290a5c1
BLAKE2b-256 2b76f9e9c471dd8bf7300e9bcfc6a92f3ca5a3ad2e967d96a5a016495b9784ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxminddb_polars-0.1.2-cp310-abi3-win_amd64.whl:

Publisher: release.yml on oschwald/maxminddb-polars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file maxminddb_polars-0.1.2-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for maxminddb_polars-0.1.2-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 de373f03c31420afc1b0da6dcce2eb0e932bb7dc48144767888d44d4ba543f98
MD5 5ef277bcce65d0997f7baca8784916e3
BLAKE2b-256 f94d50a042290bc68b98d6818a382d40baedffd990bfa4d86e5537b57c721500

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxminddb_polars-0.1.2-cp310-abi3-musllinux_1_2_x86_64.whl:

Publisher: release.yml on oschwald/maxminddb-polars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file maxminddb_polars-0.1.2-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for maxminddb_polars-0.1.2-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 38c251916c676c4947e6e7ed398797cf75f32d7b582c53e629c0049073c2e744
MD5 8912294b3e339ab6d22b2e1ca3965889
BLAKE2b-256 b8e3bc6682865ae8c2dea3d6268887d9264d2b6d921bcaed59cfbff6264a68fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxminddb_polars-0.1.2-cp310-abi3-musllinux_1_2_aarch64.whl:

Publisher: release.yml on oschwald/maxminddb-polars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file maxminddb_polars-0.1.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for maxminddb_polars-0.1.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f8e73715da14246abe9fad7457f1c40fa5b1f47b2397e455f4204833936e0278
MD5 df491828c8f0ff25b46fbe7efb9e716b
BLAKE2b-256 7eecba59d16e052d9d690cfc1e2d21cc9c5acb8d832e7e7126846ba8ebcafe50

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxminddb_polars-0.1.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on oschwald/maxminddb-polars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file maxminddb_polars-0.1.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for maxminddb_polars-0.1.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 53d14031c89aef05dc3398a72069222a89561ed0be14c00e821605da6945db17
MD5 c74d30a7cea931e283fb3839ebf10f2e
BLAKE2b-256 7e783fde74e2b61d5ae96870eb8319015f90ff3339857902d1f30c0748a3e616

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxminddb_polars-0.1.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on oschwald/maxminddb-polars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file maxminddb_polars-0.1.2-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for maxminddb_polars-0.1.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 302a344255b2d063dc0c6b6cddcb9c927c87749c992dd041c135a8dc68497c63
MD5 a86c9dcb4213eb828a911014266d2afd
BLAKE2b-256 ee1cccf4edf2c7cc7455818ddd63cb84d94cff0a86de02c799bc3ef5fd267f8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxminddb_polars-0.1.2-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on oschwald/maxminddb-polars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file maxminddb_polars-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for maxminddb_polars-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a2ef38777193a2013a5914da1a9b8703aa9b49baef3b86bdb892b168ce73781a
MD5 ad46271e484b320a62e938f03da84683
BLAKE2b-256 36737c2a1247f41ed8b06956123e97425d78afdaf7636dc785cdbe65cae8f343

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxminddb_polars-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on oschwald/maxminddb-polars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.3

8 files

This release

0.1.2 This release

8 files

0.1.1

8 files

0.1.0

8 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page