Skip to main content

Add your description here

Project description

narwhals-map

An experimental Narwhals plugin adding Map datatype.

[!TIP] See narwhals-dev/narwhals#3525 issue for more info.

Map is natively supported across all backends except for Polars.

Supported Narwhals backends:

Currently monkey-patches Narwhals to expose a new nw.col.map namespace.

Usage

import narwhals as nw
import narwhals_map  # registers the Map dtype and .map namespace

df = nw.from_native(native_df)  # use polars_map.Map for Polars-backed frames
result = df.select(nw.col("map_col").map.get("key1"))

Known Limitations

  • .to_arrow() on Polars-backed frames: Polars (via polars-map) stores maps as List(Struct({key, value})) internally. Calling .to_arrow() on a Polars-backed Narwhals frame produces list<struct<key, value>> columns instead of Arrow map types. PyArrow and Ibis backends are unaffected.

Project details


Download files

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

Source Distribution

narwhals_map-0.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

narwhals_map-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file narwhals_map-0.1.0.tar.gz.

File metadata

  • Download URL: narwhals_map-0.1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for narwhals_map-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2946f18cb0d3321bf361292c32e2c10180327fb87f213165bba75f8ddf02b588
MD5 914c7d24ccbdb13e1a7c8cf76db98966
BLAKE2b-256 afbb48df5de6ae6f5234a5b6cc47e5d49bffa64644a5628e88b5cc6dc87a2433

See more details on using hashes here.

File details

Details for the file narwhals_map-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: narwhals_map-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for narwhals_map-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 777c4818bcbb758df2ddd9554327f62a8dd90bf493d37ae3ffd3e2315265c66a
MD5 e5eec4ba1af72099b494cc3e0add5611
BLAKE2b-256 d7e6c737b469d7776720ea61910ef3c8af7e813c2733583c7345e5dd6f05b4aa

See more details on using hashes here.

Supported by

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