Python bindings for the Lingua(LanguageDetect) Rust library
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file lingua_py_unofficial-0.1.2.tar.gz
.
File metadata
- Download URL: lingua_py_unofficial-0.1.2.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.3.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 084693411b03d69bf53a74ccfcf8d83f7c1d66a3ab13ca68d056765c4c5a70ad |
|
MD5 | 3015306c963a31b16e8c308d762c6ed1 |
|
BLAKE2b-256 | 7f6cbfa65c2d75cb9fd62815b7195d36fa83360e912957ce4e59c5e159e4ceca |
File details
Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-win_amd64.whl
.
File metadata
- Download URL: lingua_py_unofficial-0.1.2-cp311-abi3-win_amd64.whl
- Upload date:
- Size: 73.0 MB
- Tags: CPython 3.11+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.3.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6786d2388643fb14e01f340ee5a9cea78439c1f9c37deff579aa18ff6ed9e736 |
|
MD5 | 56af4cd7bd744213e55d405c5e5d39e5 |
|
BLAKE2b-256 | 27766bcd95f602fcf9e168dede55e7b5b5202c709c149ce741bd8bd15c3eeb11 |
File details
Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-win32.whl
.
File metadata
- Download URL: lingua_py_unofficial-0.1.2-cp311-abi3-win32.whl
- Upload date:
- Size: 72.9 MB
- Tags: CPython 3.11+, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.3.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d68c1e3a880c109c82a605dca09ac538a732b7c2c48547d915ec489aab9ca82e |
|
MD5 | 234533fba04db21b104adf11bc27feca |
|
BLAKE2b-256 | df6d2f16710ef6f548d00b4d326c8f0e4a95c0bdc5481f4ba820848f50985730 |
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
- Download URL: lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 74.4 MB
- Tags: CPython 3.11+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.3.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 662c114957cc7bb6911096632842e4207e97cc5351bf12b614f649c3d720465e |
|
MD5 | 3e05fddd5fb9786f9a039b30029a52b3 |
|
BLAKE2b-256 | 2c4444dc46113c3a3e11aa5ffdcb7e140037192a8543870af4eac14e688b5e38 |
File details
Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
.
File metadata
- Download URL: lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
- Upload date:
- Size: 74.7 MB
- Tags: CPython 3.11+, manylinux: glibc 2.17+ s390x
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.3.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b836f3b431a1aa1f3c11ddb0284abb9497d40c2cff655ea1325415c49141e424 |
|
MD5 | ac23bb384723f507f3b1747d25bafac0 |
|
BLAKE2b-256 | 9cf92f404abfcdc3ee38c7068cf6d02556fdb1f18ebeb9ba614401b5aefb8a5f |
File details
Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
.
File metadata
- Download URL: lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
- Upload date:
- Size: 74.7 MB
- Tags: CPython 3.11+, manylinux: glibc 2.17+ ppc64le
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.3.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcb16d15c278ee489ac77f9f8f272639f968f345c7c96636c7f943d3fd38e60f |
|
MD5 | 2e4161d15e201394eefe0bfaf0f5c3cf |
|
BLAKE2b-256 | a3906410b8360cef9805263ec8098671e969acde4ae392eac8e213372b9aa11e |
File details
Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
.
File metadata
- Download URL: lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 74.3 MB
- Tags: CPython 3.11+, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.3.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 895a748512f70cb0c306ae4d36a844e3401efc5bb2992b68808724e4fe99f703 |
|
MD5 | 69982d6b6ff54f9a84ded48b1962b09b |
|
BLAKE2b-256 | 20cb8c708eb3c46429e749a11869936434e6f49aebdc3d39d3348f7a9460ff8a |
File details
Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 74.3 MB
- Tags: CPython 3.11+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.3.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43fcb311bfa2cedd710357e205a4ac7dc604370e2b8f088347f936586b813aec |
|
MD5 | 16880dbaacf3eed03289c5700547a612 |
|
BLAKE2b-256 | 16e2bffb5ea612eeedf95de2705b190042f4233bbce70c0215311561dfedcff7 |
File details
Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
.
File metadata
- Download URL: lingua_py_unofficial-0.1.2-cp311-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
- Upload date:
- Size: 74.4 MB
- Tags: CPython 3.11+, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.3.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dbdb78a92e1d32939523242bc11902aca5e68dcd11248a1ba92ee3c92bf9c4c |
|
MD5 | 7dad5b03ae6f209c146b746f03edbafb |
|
BLAKE2b-256 | 40d1426c5caf333ea4ba2076d41d8cc1caa1a5a02173a641399b1912a71a5e3a |
File details
Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: lingua_py_unofficial-0.1.2-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 73.8 MB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.3.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c457739365b80cb956ca10082045209b790835e15ab98b327354025e424cd6b7 |
|
MD5 | 3fdb2c3f7fbeb697e30c6f703f6848e8 |
|
BLAKE2b-256 | f3f9dcc574ac2b66ffc6658acb9a47f96ef539f1ccafadfe7274a8ad5a12dff0 |
File details
Details for the file lingua_py_unofficial-0.1.2-cp311-abi3-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: lingua_py_unofficial-0.1.2-cp311-abi3-macosx_10_7_x86_64.whl
- Upload date:
- Size: 73.3 MB
- Tags: CPython 3.11+, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.3.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d854977eb6a32f98377c1d3c82b7c7c758fe2834149768fcf4de5a6649a2d7c |
|
MD5 | 4dd228628e529d9dc6fafaec9ab51e9a |
|
BLAKE2b-256 | 6567633c22fce7a54bcd26fb46bdb4fde88dddf2c068210d06d4a4c142e50b0d |