Skip to main content

Language identification plugin for polars

Project description

polars-whichlang

PyPI version

This polars plugin is a wrapper for whichlang, a very fast and reasonably accurate language identification library written in rust.

It currently supports the following languages:

  • Arabic (ara)
  • Dutch (nld)
  • English (eng)
  • French (fra)
  • German (deu)
  • Hindi (hin)
  • Italian (ita)
  • Japanese (jpn)
  • Korean (kor)
  • Mandarin (cmn)
  • Portuguese (por)
  • Russian (rus)
  • Spanish (spa)
  • Swedish (swe)
  • Turkish (tur)
  • Vietnamese (vie)

Installation

pip install polars-whichlang

Examples

import polars as pl
from polars_whichlang import detect_lang

df = pl.DataFrame(
    {
        "index": [1, 2, 3, 4],
        "text": [
            "This is a test.", 
            "Đây là một bài kiểm tra.", 
            "Dies ist ein Test", 
            "这是一个测试"
        ],
    }
)

df.with_columns(detect_lang('text').alias('lang'))
shape: (4, 3)
┌───────┬──────────────────────────┬──────┐
│ index ┆ text                     ┆ lang │
│ ---   ┆ ---                      ┆ ---  │
│ i64   ┆ str                      ┆ str  │
╞═══════╪══════════════════════════╪══════╡
│ 1     ┆ This is a test.          ┆ eng  │
│ 2     ┆ Đây là một bài kiểm tra. ┆ vie  │
│ 3     ┆ Dies ist ein Test        ┆ deu  │
│ 4     ┆ 这是一个测试               ┆ cmn  │
└───────┴──────────────────────────┴──────┘

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

polars_whichlang-0.1.1.tar.gz (27.2 kB view details)

Uploaded Source

Built Distributions

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

polars_whichlang-0.1.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.9 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

polars_whichlang-0.1.1-cp39-abi3-win_amd64.whl (4.4 MB view details)

Uploaded CPython 3.9+Windows x86-64

polars_whichlang-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view details)

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

polars_whichlang-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.9 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

polars_whichlang-0.1.1-cp39-abi3-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

polars_whichlang-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: polars_whichlang-0.1.1.tar.gz
  • Upload date:
  • Size: 27.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for polars_whichlang-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0a9f07c5753de54e512fb8f5a097afe1849ca4963ad38ef4ea939f811663e8d2
MD5 b0e4b166727c6cefad4fa78669377501
BLAKE2b-256 7ad5e3bd14ddeb7cf4b25dc033e5415639601d75b4866ca7de1ae96fb2b8a383

See more details on using hashes here.

File details

Details for the file polars_whichlang-0.1.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for polars_whichlang-0.1.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 086f6ed2a1c3fe5802ac0263f581bbe337565a22b23f5fcb2a6419f86a77adbe
MD5 9e5f8bab83b3ca24d0565946bcf46369
BLAKE2b-256 40a376968ec00d20f26e303b1d42caab60e3528f30a64891571aa97de53a41f5

See more details on using hashes here.

File details

Details for the file polars_whichlang-0.1.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for polars_whichlang-0.1.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f6033e77b2478118f4b61f39a3dd1bb0ca8d211d8dac021e354fc7be04c2163a
MD5 b163a53813dbb967eb00a72e0df059c8
BLAKE2b-256 3454f2dfd9bd94aaa1dc08e05157fb7889b0e36438450e0ba2aebc482a69675a

See more details on using hashes here.

File details

Details for the file polars_whichlang-0.1.1-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for polars_whichlang-0.1.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7f879379a0e9d70b364fb5e25e506f4ad73d437f80f704557926efd2df5a0bf3
MD5 3247d48c81a98ec6b5cd8d0f3345c7c1
BLAKE2b-256 e088b184908456abee1deb0769a2356832155fa7ce746f24b56f537428cc1a18

See more details on using hashes here.

File details

Details for the file polars_whichlang-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polars_whichlang-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b32367ea2b98261fcf691f4a5156b7c429a90cde9906e61630dcbada2d210bd8
MD5 34c879bde05bf719a950433bb0da917d
BLAKE2b-256 4ff9e63bd27d78882cd762531d9b888ad9d087c0ec588474c00ed5c001c7fcc4

See more details on using hashes here.

File details

Details for the file polars_whichlang-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for polars_whichlang-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 68b6c539db3074711c6a4f6b3e4f4a538005a5cf5739bbeb759c277a8a2a2b17
MD5 1c7a2d0c6cb942ec27f41bca20874b10
BLAKE2b-256 2aa1b429459bd81eee350d642dd66ed82be6af4649af3d4f5a4f39d5c1b698f5

See more details on using hashes here.

File details

Details for the file polars_whichlang-0.1.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polars_whichlang-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 96d79844878e660d7713ed3b4352afc9c60c4a72028c5a0de0d59d7ba0c0766a
MD5 2411db89d72abd2d8d06b4c8656d64a3
BLAKE2b-256 7a25d8cd09fbf492e4d6522485944b44daa621b897e3f7312455f227e017d1ce

See more details on using hashes here.

File details

Details for the file polars_whichlang-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for polars_whichlang-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6aa13653c0cf5559489671b2a140e5a0829f905f20c3f27c73f31d8c6cb0c88a
MD5 ed5a905191bb2a042c1f0dd450ba3c1e
BLAKE2b-256 d71404179a39cd58f888d24b8bd14b031815f5b33e122fe074aad8a2506c9681

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