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.1.tar.gz (154.7 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.1-cp310-abi3-win_amd64.whl (6.6 MB view details)

Uploaded CPython 3.10+Windows x86-64

maxminddb_polars-0.1.1-cp310-abi3-musllinux_1_2_x86_64.whl (7.1 MB view details)

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

maxminddb_polars-0.1.1-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.1-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.1-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.1-cp310-abi3-macosx_11_0_arm64.whl (6.0 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

maxminddb_polars-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl (6.5 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: maxminddb_polars-0.1.1.tar.gz
  • Upload date:
  • Size: 154.7 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.1.tar.gz
Algorithm Hash digest
SHA256 94ca2d584b20ebc67211e786e4072b5b2e4f1c6f0b3e9b061bb423158a74748e
MD5 7711d359b8ef2e0b33dc608ff8d56a49
BLAKE2b-256 5b851d7ee2dd05b4a864769bb50737be8075558e7b3928b788bb452bf38975f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxminddb_polars-0.1.1.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.1-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for maxminddb_polars-0.1.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 29d4fbd4198765031e0e82eb3f4f54018ecb24b6ed92830ea97f926490069af0
MD5 ad4fc9b708cbe3754725a52c81c74913
BLAKE2b-256 8b0ee13c6b07dcd4939325594b81c8783f7bf2466e208e682094d41123af4d64

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxminddb_polars-0.1.1-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.1-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for maxminddb_polars-0.1.1-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 09bf6c97b2d97c9f057a01243ccea488ab4fcf1479a1dc68d0474151addb4b97
MD5 505390d1d88dd5877ccf51af1b3eac80
BLAKE2b-256 d5d73e5b8790128426594aa9ce03d60cc83a9f174281f9488ec7985a0dfd7d50

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxminddb_polars-0.1.1-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.1-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for maxminddb_polars-0.1.1-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 9e5284f92da827cec5c14a5b5109cb3cc5b10b7a311906ef98b41173affe3865
MD5 d0337437fec45fc9d9ab1a9b20c0c6fe
BLAKE2b-256 28eb851e0659eb4b7e71ce51880d54f738ec9f0be9b77df15d40c3f5b9bccd26

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxminddb_polars-0.1.1-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.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for maxminddb_polars-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1270c78c52094eec4d0db4788ae7c61f2dd3d59567948a7ee20851cd7e7629b5
MD5 3af44b7e3f501daa50d7b92441ef1fe9
BLAKE2b-256 44b09023933111c32b5c8e6caaf761a70ae80e5d2aff5092bb9ae4a24527fe09

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxminddb_polars-0.1.1-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.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for maxminddb_polars-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6af4bcbd8dfa98c9af43c00b187baa653ac30fbcd219a58323c5332d9a4fa179
MD5 50ddb720fc9d3be0f8e1c15240afe345
BLAKE2b-256 a604002d21c00821562886279263785ae82f1bd2363b08d054fc3311756d9646

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxminddb_polars-0.1.1-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.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for maxminddb_polars-0.1.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d650c34b6356872894caff9d2adc56a20c1a90ab04f2711e887c5a82148283ad
MD5 bf9ae484c15b6d1677f016a2a695da27
BLAKE2b-256 d6430dbb726213edf9fd23e5c56beb06d746773176ed735affd3dfe5de9f69b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxminddb_polars-0.1.1-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.1-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for maxminddb_polars-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3dd2e467ee42be1781d07de455b8d0e40ad4003a06c3fd67ebcc62fb73f4054f
MD5 014934739149a0826160d14d520f745f
BLAKE2b-256 7990a1fd2986e69fff667ff7e01a166987e90210b60575f658bc036fb7620ae9

See more details on using hashes here.

Provenance

The following attestation bundles were made for maxminddb_polars-0.1.1-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

0.1.2

8 files

This release

0.1.1 This release

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