<div align="center">
![lingua](https://raw.githubusercontent.com/pemistahl/lingua-rs/main/images/logo.png)
![Static Badge](https://img.shields.io/badge/dependency_version%3Alingua-1.5.0-blue)
[![build status](https://github.com/chatblanc-ciel/lingua-py/actions/workflows/CI.yml/badge.svg)](https://github.com/chatblanc-ciel/lingua-py/actions/workflows/CI.yml)
![PyPI - Version](https://img.shields.io/pypi/v/lingua_py)
[![license](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
</div>
<br>
# Lingua-py
Lingua-py is an Python wrapper for the [Rust][1] [lingua][2] crate with [PyO3/Maturin][4].
## Summary
Lingua is a NIF-based bridge for the [lingua][2] [Rust][1] language detection library.
## Usage
In imitation of [Upstream][3], introduce basic usage.
Alternatively please see [`tests` section](https://github.com/chatblanc-ciel/lingua-py/tree/master/python/tests/small_usage).
### 10.1 [Basic usage](https://github.com/pemistahl/lingua-rs#101-basic-usage)
```python
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
```
<details>
<summary>pytest command</summary>
```bash
rye sync --no-lock
rye run python -m pytest -s -vv python/tests/small_usage/test_basic.py::test_basic
```
</details>
# License
[Apache License v2](./LICENSE), and lingua-rs is also [Apache License v2](https://github.com/pemistahl/lingua-rs/blob/master/LICENSE).
[1]: https://www.rust-lang.org
[2]: https://crates.io/crates/lingua
[3]: https://github.com/pemistahl/lingua-rs.git
[4]: https://www.maturin.rs/
Raw data
{
"_id": null,
"home_page": null,
"name": "lingua-py",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11, <3.12",
"maintainer_email": null,
"keywords": "nlp,language-detect,rust,rust-library,python-bindings",
"author": null,
"author_email": "chatblanc <73688885+chatblanc-ciel@users.noreply.github.com>",
"download_url": "https://files.pythonhosted.org/packages/bc/db/d85b2e047e29d53c5e513e1170274ab0cc017042e3982754a3c8e27583e1/lingua_py-0.1.1.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n\n ![lingua](https://raw.githubusercontent.com/pemistahl/lingua-rs/main/images/logo.png)\n \n ![Static Badge](https://img.shields.io/badge/dependency_version%3Alingua-1.5.0-blue)\n [![build status](https://github.com/chatblanc-ciel/lingua-py/actions/workflows/CI.yml/badge.svg)](https://github.com/chatblanc-ciel/lingua-py/actions/workflows/CI.yml)\n ![PyPI - Version](https://img.shields.io/pypi/v/lingua_py)\n [![license](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n</div>\n\n<br>\n\n# Lingua-py\n\nLingua-py is an Python wrapper for the [Rust][1] [lingua][2] crate with [PyO3/Maturin][4].\n\n## Summary\n\nLingua is a NIF-based bridge for the [lingua][2] [Rust][1] language detection library.\n\n## Usage \n\nIn imitation of [Upstream][3], introduce basic usage.\nAlternatively please see [`tests` section](https://github.com/chatblanc-ciel/lingua-py/tree/master/python/tests/small_usage).\n\n### 10.1 [Basic usage](https://github.com/pemistahl/lingua-rs#101-basic-usage)\n\n```python\n languages: list[Language] = [Language.English, Language.Japanese]\n detector: LanguageDetector = LanguageDetectorBuilder.from_languages(\n languages\n ).build()\n\n expected: Language = Language.Japanese\n actual: Language = detector.detect_language_of(\"\u3053\u308c\u306f\u4f55\u8a9e\u3067\u3059\u304b\uff1f\")\n\n assert actual == expected\n```\n<details>\n<summary>pytest command</summary>\n\n```bash\nrye sync --no-lock\nrye run python -m pytest -s -vv python/tests/small_usage/test_basic.py::test_basic\n```\n</details>\n\n\n# License\n\n[Apache License v2](./LICENSE), and lingua-rs is also [Apache License v2](https://github.com/pemistahl/lingua-rs/blob/master/LICENSE).\n\n\n\n\n\n\n[1]: https://www.rust-lang.org \n[2]: https://crates.io/crates/lingua\n[3]: https://github.com/pemistahl/lingua-rs.git\n[4]: https://www.maturin.rs/\n",
"bugtrack_url": null,
"license": null,
"summary": "Python bindings for the Lingua(LanguageDetect) Rust library",
"version": "0.1.1",
"project_urls": {
"Repository": "https://github.com/chatblanc-ciel/lingua-py.git"
},
"split_keywords": [
"nlp",
"language-detect",
"rust",
"rust-library",
"python-bindings"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "9f2131eaefdc5c7d5a5cfcb45426b9999897a99891020c0de528b305ef604b0a",
"md5": "eb9e2301a4428d5d84779a2b1b70fb7b",
"sha256": "1938a5a4716c82160f4eed5659d82334af9811fbaec16c7a109b6ef989689687"
},
"downloads": -1,
"filename": "lingua_py-0.1.1-cp311-abi3-macosx_10_7_x86_64.whl",
"has_sig": false,
"md5_digest": "eb9e2301a4428d5d84779a2b1b70fb7b",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.11, <3.12",
"size": 73323661,
"upload_time": "2023-10-23T04:40:33",
"upload_time_iso_8601": "2023-10-23T04:40:33.574349Z",
"url": "https://files.pythonhosted.org/packages/9f/21/31eaefdc5c7d5a5cfcb45426b9999897a99891020c0de528b305ef604b0a/lingua_py-0.1.1-cp311-abi3-macosx_10_7_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7c37f1b47619f46e277f2effdb3037ba7e6897df0b93e09251c1d8b99f1bd4de",
"md5": "557b53024c973c1d4ee7296eb7bd717e",
"sha256": "3133faacaa84a85bc2e6b8d4e9fc18de6046d1218495715eb3dd66872448ba0b"
},
"downloads": -1,
"filename": "lingua_py-0.1.1-cp311-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "557b53024c973c1d4ee7296eb7bd717e",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.11, <3.12",
"size": 73799334,
"upload_time": "2023-10-23T04:40:44",
"upload_time_iso_8601": "2023-10-23T04:40:44.832350Z",
"url": "https://files.pythonhosted.org/packages/7c/37/f1b47619f46e277f2effdb3037ba7e6897df0b93e09251c1d8b99f1bd4de/lingua_py-0.1.1-cp311-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "49798daad41fc41127b03c7d47a1351f92dd4fc75c8f0ddaacbad3e6d871f2a1",
"md5": "f50c1fdef25071a547ef170358ffe4d8",
"sha256": "1bc7895261c115d6487a7dc9d146c5f331b565e4e8a00191c3f2b70717afb4c2"
},
"downloads": -1,
"filename": "lingua_py-0.1.1-cp311-abi3-manylinux_2_12_i686.manylinux2010_i686.whl",
"has_sig": false,
"md5_digest": "f50c1fdef25071a547ef170358ffe4d8",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.11, <3.12",
"size": 74391674,
"upload_time": "2023-10-23T04:40:50",
"upload_time_iso_8601": "2023-10-23T04:40:50.724273Z",
"url": "https://files.pythonhosted.org/packages/49/79/8daad41fc41127b03c7d47a1351f92dd4fc75c8f0ddaacbad3e6d871f2a1/lingua_py-0.1.1-cp311-abi3-manylinux_2_12_i686.manylinux2010_i686.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "bd0ba132b722671316e7f0f296e320c1953ba7bf730fde68317b05bb423811d4",
"md5": "044e9fa3b734d60e6cdd996c0c12798a",
"sha256": "4f214e79d2fbf614c6fe978bd39508564a4137fc62a05ff7e007474f32941a26"
},
"downloads": -1,
"filename": "lingua_py-0.1.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "044e9fa3b734d60e6cdd996c0c12798a",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.11, <3.12",
"size": 74329470,
"upload_time": "2023-10-23T04:40:56",
"upload_time_iso_8601": "2023-10-23T04:40:56.493303Z",
"url": "https://files.pythonhosted.org/packages/bd/0b/a132b722671316e7f0f296e320c1953ba7bf730fde68317b05bb423811d4/lingua_py-0.1.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9ee04dcb532ca7c8cf3b950ff876d7846bd9b64a130cc39057336c1c51dca9b8",
"md5": "256e681cfacc14b6a2fede96ca44403f",
"sha256": "88cac35d2832f6e94211df00bd355ef414998eab3bafaf645ae1585f680e253a"
},
"downloads": -1,
"filename": "lingua_py-0.1.1-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
"has_sig": false,
"md5_digest": "256e681cfacc14b6a2fede96ca44403f",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.11, <3.12",
"size": 74288692,
"upload_time": "2023-10-23T04:41:02",
"upload_time_iso_8601": "2023-10-23T04:41:02.946624Z",
"url": "https://files.pythonhosted.org/packages/9e/e0/4dcb532ca7c8cf3b950ff876d7846bd9b64a130cc39057336c1c51dca9b8/lingua_py-0.1.1-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "47067edaca0403ab53155abdee5ed950009ac8be3ea564fa16d612c7a3b30d2f",
"md5": "3ed37a7d7724375227f70f97d34b80cb",
"sha256": "de85a74e5ac53044ee491ee0def843b9033f45ccafcac6f91e2d145e9c1dc8bb"
},
"downloads": -1,
"filename": "lingua_py-0.1.1-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl",
"has_sig": false,
"md5_digest": "3ed37a7d7724375227f70f97d34b80cb",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.11, <3.12",
"size": 74721778,
"upload_time": "2023-10-23T04:41:08",
"upload_time_iso_8601": "2023-10-23T04:41:08.669914Z",
"url": "https://files.pythonhosted.org/packages/47/06/7edaca0403ab53155abdee5ed950009ac8be3ea564fa16d612c7a3b30d2f/lingua_py-0.1.1-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "db3b08a89f2f899a41253ff12b7977d46b55f10a15ca9425150a6984880838ae",
"md5": "3d2eb40efbc342f57b443219493a8ef7",
"sha256": "7e6848882c0236b57bba487735d580f6361b9cbca20fac78257101da836a45c8"
},
"downloads": -1,
"filename": "lingua_py-0.1.1-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl",
"has_sig": false,
"md5_digest": "3d2eb40efbc342f57b443219493a8ef7",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.11, <3.12",
"size": 74709037,
"upload_time": "2023-10-23T04:41:14",
"upload_time_iso_8601": "2023-10-23T04:41:14.838202Z",
"url": "https://files.pythonhosted.org/packages/db/3b/08a89f2f899a41253ff12b7977d46b55f10a15ca9425150a6984880838ae/lingua_py-0.1.1-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c1a1e4a0561114064b638ca9d900198458badabe56dbcb0f0c3a899205119a76",
"md5": "e13ef948974f8c0af70b3f7eb85e0a51",
"sha256": "e5753cf2a14fac2581578c01bf8de7ef1fdbadbe80cc1cef0a4a6248181740c3"
},
"downloads": -1,
"filename": "lingua_py-0.1.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "e13ef948974f8c0af70b3f7eb85e0a51",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.11, <3.12",
"size": 74364943,
"upload_time": "2023-10-23T04:41:20",
"upload_time_iso_8601": "2023-10-23T04:41:20.701280Z",
"url": "https://files.pythonhosted.org/packages/c1/a1/e4a0561114064b638ca9d900198458badabe56dbcb0f0c3a899205119a76/lingua_py-0.1.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "da5d61b9a2044d53cde2521f3ba45fd623ae4dc0613e430102c0c7947ed5baac",
"md5": "700ffbfb95378d5e058dcdbb2adad9e5",
"sha256": "ce7712a55e19b1e38eadd9a05f05c3021395c9d0e2d13234c826baf343600256"
},
"downloads": -1,
"filename": "lingua_py-0.1.1-cp311-abi3-win32.whl",
"has_sig": false,
"md5_digest": "700ffbfb95378d5e058dcdbb2adad9e5",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.11, <3.12",
"size": 72948401,
"upload_time": "2023-10-23T04:41:27",
"upload_time_iso_8601": "2023-10-23T04:41:27.015076Z",
"url": "https://files.pythonhosted.org/packages/da/5d/61b9a2044d53cde2521f3ba45fd623ae4dc0613e430102c0c7947ed5baac/lingua_py-0.1.1-cp311-abi3-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "8fe2d7db58f7c911a22b466ec814810d4b8e8176487259635b73fd65cf813175",
"md5": "df179e655047ef35e72f0cc549469797",
"sha256": "1f1b137cef8933c56c3c0b4c87153fdff017585064e51e11d1aed0e5aa0b8732"
},
"downloads": -1,
"filename": "lingua_py-0.1.1-cp311-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "df179e655047ef35e72f0cc549469797",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.11, <3.12",
"size": 73032032,
"upload_time": "2023-10-23T04:41:32",
"upload_time_iso_8601": "2023-10-23T04:41:32.867010Z",
"url": "https://files.pythonhosted.org/packages/8f/e2/d7db58f7c911a22b466ec814810d4b8e8176487259635b73fd65cf813175/lingua_py-0.1.1-cp311-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "bcdbd85b2e047e29d53c5e513e1170274ab0cc017042e3982754a3c8e27583e1",
"md5": "a428359708bed9d7df890a6612e27c6d",
"sha256": "45c15d98ec277e571121819d35cbf83bfac09f5a62a97137807d226f87bb1351"
},
"downloads": -1,
"filename": "lingua_py-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "a428359708bed9d7df890a6612e27c6d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11, <3.12",
"size": 22540,
"upload_time": "2023-10-23T04:41:36",
"upload_time_iso_8601": "2023-10-23T04:41:36.846603Z",
"url": "https://files.pythonhosted.org/packages/bc/db/d85b2e047e29d53c5e513e1170274ab0cc017042e3982754a3c8e27583e1/lingua_py-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-23 04:41:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "chatblanc-ciel",
"github_project": "lingua-py",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "lingua-py"
}