Skip to main content

Python bindings for the Lingua(LanguageDetect) Rust library

Project description

Static Badge build status PyPI - Version license


Lingua-py

Lingua-py is an Python wrapper for the Rust lingua crate with PyO3/Maturin. This project is informal. It is expected that Python-binding will be developed officially in the future.

Summary

Lingua is a NIF-based bridge for the lingua Rust language detection library.

Usage

In imitation of Upstream, introduce basic usage. Alternatively please see tests section.

10.1 Basic usage

    languages: list[Language] = [Language.English, Language.Japanese]
    detector: LanguageDetector = LanguageDetectorBuilder.from_languages(
        languages
    ).build()

    expected: Language = Language.Japanese
    actual: Language = detector.detect_language_of("これは何語ですか?")

    assert actual == expected
pytest command
rye sync --no-lock
rye run python -m pytest -s -vv python/tests/small_usage/test_basic.py::test_basic

License

Apache License v2, and lingua-rs is also Apache License v2.

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

lingua_py_unofficial-0.1.2.tar.gz (22.6 kB view details)

Uploaded Source

Built Distributions

lingua_py_unofficial-0.1.2-cp311-abi3-win_amd64.whl (73.0 MB view details)

Uploaded CPython 3.11+ Windows x86-64

lingua_py_unofficial-0.1.2-cp311-abi3-win32.whl (72.9 MB view details)

Uploaded CPython 3.11+ Windows x86

lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (74.4 MB view details)

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

lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (74.7 MB view details)

Uploaded CPython 3.11+ manylinux: glibc 2.17+ s390x

lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (74.7 MB view details)

Uploaded CPython 3.11+ manylinux: glibc 2.17+ ppc64le

lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (74.3 MB view details)

Uploaded CPython 3.11+ manylinux: glibc 2.17+ ARMv7l

lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (74.3 MB view details)

Uploaded CPython 3.11+ manylinux: glibc 2.17+ ARM64

lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_12_i686.manylinux2010_i686.whl (74.4 MB view details)

Uploaded CPython 3.11+ manylinux: glibc 2.12+ i686

lingua_py_unofficial-0.1.2-cp311-abi3-macosx_11_0_arm64.whl (73.8 MB view details)

Uploaded CPython 3.11+ macOS 11.0+ ARM64

lingua_py_unofficial-0.1.2-cp311-abi3-macosx_10_7_x86_64.whl (73.3 MB view details)

Uploaded CPython 3.11+ macOS 10.7+ x86-64

File details

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

File metadata

File hashes

Hashes for lingua_py_unofficial-0.1.2.tar.gz
Algorithm Hash digest
SHA256 084693411b03d69bf53a74ccfcf8d83f7c1d66a3ab13ca68d056765c4c5a70ad
MD5 3015306c963a31b16e8c308d762c6ed1
BLAKE2b-256 7f6cbfa65c2d75cb9fd62815b7195d36fa83360e912957ce4e59c5e159e4ceca

See more details on using hashes here.

File details

Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for lingua_py_unofficial-0.1.2-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6786d2388643fb14e01f340ee5a9cea78439c1f9c37deff579aa18ff6ed9e736
MD5 56af4cd7bd744213e55d405c5e5d39e5
BLAKE2b-256 27766bcd95f602fcf9e168dede55e7b5b5202c709c149ce741bd8bd15c3eeb11

See more details on using hashes here.

File details

Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-win32.whl.

File metadata

File hashes

Hashes for lingua_py_unofficial-0.1.2-cp311-abi3-win32.whl
Algorithm Hash digest
SHA256 d68c1e3a880c109c82a605dca09ac538a732b7c2c48547d915ec489aab9ca82e
MD5 234533fba04db21b104adf11bc27feca
BLAKE2b-256 df6d2f16710ef6f548d00b4d326c8f0e4a95c0bdc5481f4ba820848f50985730

See more details on using hashes here.

File details

Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 662c114957cc7bb6911096632842e4207e97cc5351bf12b614f649c3d720465e
MD5 3e05fddd5fb9786f9a039b30029a52b3
BLAKE2b-256 2c4444dc46113c3a3e11aa5ffdcb7e140037192a8543870af4eac14e688b5e38

See more details on using hashes here.

File details

Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 b836f3b431a1aa1f3c11ddb0284abb9497d40c2cff655ea1325415c49141e424
MD5 ac23bb384723f507f3b1747d25bafac0
BLAKE2b-256 9cf92f404abfcdc3ee38c7068cf6d02556fdb1f18ebeb9ba614401b5aefb8a5f

See more details on using hashes here.

File details

Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 dcb16d15c278ee489ac77f9f8f272639f968f345c7c96636c7f943d3fd38e60f
MD5 2e4161d15e201394eefe0bfaf0f5c3cf
BLAKE2b-256 a3906410b8360cef9805263ec8098671e969acde4ae392eac8e213372b9aa11e

See more details on using hashes here.

File details

Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 895a748512f70cb0c306ae4d36a844e3401efc5bb2992b68808724e4fe99f703
MD5 69982d6b6ff54f9a84ded48b1962b09b
BLAKE2b-256 20cb8c708eb3c46429e749a11869936434e6f49aebdc3d39d3348f7a9460ff8a

See more details on using hashes here.

File details

Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 43fcb311bfa2cedd710357e205a4ac7dc604370e2b8f088347f936586b813aec
MD5 16880dbaacf3eed03289c5700547a612
BLAKE2b-256 16e2bffb5ea612eeedf95de2705b190042f4233bbce70c0215311561dfedcff7

See more details on using hashes here.

File details

Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 4dbdb78a92e1d32939523242bc11902aca5e68dcd11248a1ba92ee3c92bf9c4c
MD5 7dad5b03ae6f209c146b746f03edbafb
BLAKE2b-256 40d1426c5caf333ea4ba2076d41d8cc1caa1a5a02173a641399b1912a71a5e3a

See more details on using hashes here.

File details

Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lingua_py_unofficial-0.1.2-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c457739365b80cb956ca10082045209b790835e15ab98b327354025e424cd6b7
MD5 3fdb2c3f7fbeb697e30c6f703f6848e8
BLAKE2b-256 f3f9dcc574ac2b66ffc6658acb9a47f96ef539f1ccafadfe7274a8ad5a12dff0

See more details on using hashes here.

File details

Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for lingua_py_unofficial-0.1.2-cp311-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 3d854977eb6a32f98377c1d3c82b7c7c758fe2834149768fcf4de5a6649a2d7c
MD5 4dd228628e529d9dc6fafaec9ab51e9a
BLAKE2b-256 6567633c22fce7a54bcd26fb46bdb4fde88dddf2c068210d06d4a4c142e50b0d

See more details on using hashes here.

Supported by

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