Skip to main content

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  │
└───────┴──────────────────────────┴──────┘

Metadata

Release files for polars-whichlang 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for polars-whichlang 0.1.2
File Size Uploaded
polars_whichlang-0.1.2.tar.gz 29.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for polars-whichlang 0.1.2
File
polars_whichlang-0.1.2-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
polars_whichlang-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
polars_whichlang-0.1.2-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
polars_whichlang-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details
polars_whichlang-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details

Total release size: 24.4 MB

Release files / polars_whichlang-0.1.2.tar.gz

Download URL polars_whichlang-0.1.2.tar.gz
Size 29.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2a4b7987686f64c5bfcb736c7a3847c84a9eef54adf7ba0f518cdb211d6f98a5
BLAKE2b-256 checksum
How to use checksums
a2f1edfe0d0ff5a07d059b75e02b89928f8ce11ad140f77036d15b9f95cb9f3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release files / polars_whichlang-0.1.2-cp39-abi3-win_amd64.whl

Download URL polars_whichlang-0.1.2-cp39-abi3-win_amd64.whl
Size 4.7 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
58ce12b6bc50c77073db4b451034420f312f368d648eab706cf13906d341b640
BLAKE2b-256 checksum
How to use checksums
1f2418a1d10ed4f6ce89e03d64150d468eece15f1dbc185df22437108a3ce8e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release files / polars_whichlang-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL polars_whichlang-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 5.3 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
c3ec4b07ae06c6a3c5cfb27bcc3a1504806d7775701824a8b95d47e39b4304b5
BLAKE2b-256 checksum
How to use checksums
d64124cfff168bac32fc4b5c7e7b3534d3022a387086898086ed51f0a1a342e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release files / polars_whichlang-0.1.2-cp39-abi3-macosx_11_0_arm64.whl

Download URL polars_whichlang-0.1.2-cp39-abi3-macosx_11_0_arm64.whl
Size 4.4 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
641c4a1814d1e57cf08c5603d7de7368f63637608431c897d4f525a141ff0646
BLAKE2b-256 checksum
How to use checksums
032c381b03def937fcddc90b8eb655ff80e76fdf5813cce8ee0294ff56cc61c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release files / polars_whichlang-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl

Download URL polars_whichlang-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl
Size 4.6 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
07a64a20b865d169bcbb778e29b5721feb3058794690539181d05dddc7861394
BLAKE2b-256 checksum
How to use checksums
12da44774ebcb12f2180ae4d5d2ba0555e1ec5d53c40373ff539ac1ade946cba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release files / polars_whichlang-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL polars_whichlang-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 5.3 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a88428e3dc7a07e663f97cc40a053bace90668d2ff8f2547fd5ddee126a9b4d2
BLAKE2b-256 checksum
How to use checksums
7740c8f086714c7aa2daf5670103eec8e5c3bf53680a8e64b32beb2c79540a8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release history Release notifications | RSS feed

This release

0.1.2 This release

6 release files

0.1.1

8 release files

0.1.0

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page