Python bindings for whatlang using pyo3
Project description
Python Binding for WhatLang
WhatLang is a Python library for detecting the language of a text. It is based on the WhatLang Rust library.
Installation
pip install whatlang-pyo3
Usage
Detect
>>> from whatlang import detect
>>> info = detect("This is written in English")
"Language: eng - Script: Latin - Confidence: 0.11450955767632877 - Is reliable: false"
>>> info.lang
"eng"
>>> info.script
"Latin"
>>> info.confidence
0.11450955767632877
>>> info.is_reliable
False
>>> info.to_iso()
"Language: en - Script: Latin - Confidence: 0.11450955767632877 - Is reliable: false"
Detect language
You can also detect the language of a text without the script and the confidence.
>>> from whatlang import detect_lang
>>> detect_lang("This is written in English")
"eng"
>>> detect_lang("Ceci est écrit en français")
"fra"
Detect script
You can also detect the script of a text without the language and the confidence.
>>> from whatlang import detect_script
>>> detect_script("This is written in English")
Name: Latin - Languages: spa, eng, por, ind, fra, deu, jav, vie, ita, tur, pol, ron, hrv, nld, uzb, hun, aze, ces, zul, swe, aka, sna, afr, fin, slk, tgl, tuk, dan, nob, cat, lit, slv, epo, lav, est, lat
>>> detect_script.name
"Latin"
>>> detect_script.langs
['spa', 'eng', 'por', 'ind', 'fra', 'deu', 'jav', 'vie', 'ita', 'tur', 'pol', 'ron', 'hrv', 'nld', 'uzb', 'hun', 'aze', 'ces', 'zul', 'swe', 'aka', 'sna', 'afr', 'fin', 'slk', 'tgl', 'tuk', 'dan', 'nob', 'cat', 'lit', 'slv', 'epo', 'lav', 'est', 'lat']
Contributing
Contributions are welcome! Please open an issue or a pull request.
Install maturin
pip install maturin
Build
maturin build --release
License
This project is licensed under the MIT License - see the LICENSE file for details
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
whatlang_pyo3-0.4.0.tar.gz
(1.3 MB
view hashes)
Built Distributions
Close
Hashes for whatlang_pyo3-0.4.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 346084e5311b09034ce578bfd112fcf1852a20cf7ab755f0941a5c55fb446553 |
|
MD5 | b5bdaf15d1a0ed8653c21b84156accfb |
|
BLAKE2b-256 | 02699cc58607e19380d897596e0baae43c21f1a33de7fbf14e665934f442a14b |
Close
Hashes for whatlang_pyo3-0.4.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49914eb6da99fd4971e10839a6604212eb7bba690d407641fd700ba22806277c |
|
MD5 | d01b03709ec1f1abedbfbae34acecf53 |
|
BLAKE2b-256 | 22db82e66597827a2819b44a7b0ac0a869c01f1825b5af2df0c6224ec023fc91 |
Close
Hashes for whatlang_pyo3-0.4.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc65296cdef5519ec61ef7bbea1f3c5574dd5058ea2f4dc6c89466d2c0ddaec3 |
|
MD5 | 6500141ce4c89755c0b20b5db29f3e90 |
|
BLAKE2b-256 | 72531eddb379be1da7c8fc9b0673173b505e6ab257400007337e512bd99ebce0 |
Close
Hashes for whatlang_pyo3-0.4.0-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71628c7ce966c801ddc0ed100aa6a902bc11203a3ee252eba47f331ea4f40280 |
|
MD5 | 26e60c4a59bb9bba490feb979ee59d96 |
|
BLAKE2b-256 | 37e20c2bd75d66fd62d65ab8da4dd58beb6a003c5c9a1360fa7919eb3a61b697 |
Close
Hashes for whatlang_pyo3-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30985eb90bb0f03a04281c20df8e60f7e7cf23769c863fec87f37989649fc5be |
|
MD5 | df829597bdf713ad059af7a70089aced |
|
BLAKE2b-256 | 1221ae1b08ef370c8b706b02c0d348c516de090e94305b142d8a915b3fa53106 |
Close
Hashes for whatlang_pyo3-0.4.0-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6856387cd85b6bf7bae22ee0c362508634cd964d4e02eabb5691ea4e8bd59a0 |
|
MD5 | cb04d65bebb7b488ecafcb7b9efe44af |
|
BLAKE2b-256 | 3f87df01d6783ee3544fe544af83e8920f1fc7d463c8ba2f55644017dbb52496 |
Close
Hashes for whatlang_pyo3-0.4.0-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17ce8bf616816bb2d898ee9c5da7b821dfd16003887ecc2a231d0efebbaf7b12 |
|
MD5 | df9181b714fce63d234a7b8edf499571 |
|
BLAKE2b-256 | c29f07ee946a57649eb47034319962532de32f7ec8e21acab19ce7a390312526 |
Close
Hashes for whatlang_pyo3-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d06ac1bbe6e3adefc2737513309a1dccfbf54dd008828f82ae272e06f16c6b9 |
|
MD5 | b28f64b816c431efe369c4a53d24640f |
|
BLAKE2b-256 | df1e34b3f5c18df3a7abd322a1b4f3aea6b56f395b56d64d522a043441512730 |
Close
Hashes for whatlang_pyo3-0.4.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e5961cab71e3cadfd6924430e6180cd3d113509876cb8d869a149234d7b1a70 |
|
MD5 | 12792570c52e75f00bd4b17b95eb5c6d |
|
BLAKE2b-256 | f8f5d8b34d4c5c2bb8d4778df7f1da8d1fb51be82a3f5c2ccb019d1594eee00c |
Close
Hashes for whatlang_pyo3-0.4.0-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3eb484df13c2bae409764ab6153f6d59d3f0007e0cac46229610f74bcd2e3127 |
|
MD5 | 9a4d213f7d48540e23f5315d4efb7481 |
|
BLAKE2b-256 | 28ceaba9a3cfc093c8f488a2d91ec0b5f63be4be1b4f9437b6635103dbf515ef |
Close
Hashes for whatlang_pyo3-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc4b7771befa8a78c50835dcca5725dba2ec410b57718ce14e47c4e6b11f3e80 |
|
MD5 | 3a3f8c55c4b6f19b5076b2d48cf907d6 |
|
BLAKE2b-256 | 9fe93bccf1943f6a880808cfeac9cb9b959e359ab883957ef232649d729268b8 |
Close
Hashes for whatlang_pyo3-0.4.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9659129d1fc7b196330186f68f44e81e7e9e08cc5365b97d2cd91db2c3eca820 |
|
MD5 | 6a7c043f3ea8d1149994625d8296590c |
|
BLAKE2b-256 | 54ac7bc756a002025ccbce0ac1dbb9fb90eb6f55283ad9dc8d6ae65d1cb48835 |
Close
Hashes for whatlang_pyo3-0.4.0-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b90344995b781262f521ade0045ca371782152309db941b16359ab72c5d11e1 |
|
MD5 | 079b7f89afc7b97946640ead59c5fa45 |
|
BLAKE2b-256 | 80b725c90862fced47456f545e1f21e696d6098e1f4a89927e6a7d6f1036156f |
Close
Hashes for whatlang_pyo3-0.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3322232a2bf7ca23824790696cb9c24d9dff42339e26f9f9f33874fdc072d572 |
|
MD5 | 26bd8c6a5ec81c67cd06163c40f9b17e |
|
BLAKE2b-256 | 22990e47d69bd83d094a4572be6331b982e321e9d45d753dda02b0585695ff40 |
Close
Hashes for whatlang_pyo3-0.4.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca41b87a741e9022d644742359f4a6d99a140dc95dde3ac775df32056c4a1f5d |
|
MD5 | 9f7e3d364ae96ba9b881eaed12155b68 |
|
BLAKE2b-256 | 56f62a7559a0e1b317b8c6092470268771332c1dba6437da3d6a752d5660b5c2 |
Close
Hashes for whatlang_pyo3-0.4.0-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfdddec747f80ad06a951e9fccdefd4d442717fe6a751c52517d903da91e118a |
|
MD5 | 7308b7645268c2758e6f8969a2aa6294 |
|
BLAKE2b-256 | c032368a049fb4b09448f140adfa0a1e10f77e949faaeeb3a85d4095dad05c85 |
Close
Hashes for whatlang_pyo3-0.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cf496fb197286a2ef9ef5993c3805616656a16ab4feada9a537838c8dcd17dc |
|
MD5 | 20892aed6955629682aba5feafdad3d0 |
|
BLAKE2b-256 | 4e8b96b4848ca276e9b004fbc718cb53ca1be8a6bde1d68f9922f598fbc3f02b |
Close
Hashes for whatlang_pyo3-0.4.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4bddfad7103650cd900cddb1bc4d166f2bbb65c47f18f35259b2a0c83dd326a |
|
MD5 | 4869f2bd4856187145c668ed9296d53e |
|
BLAKE2b-256 | eb4a60c78c0513df30a276f3df9efc9eac2857b2178748ec070fad4644dd415b |