No project description provided
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
>>> detect("This is written in English")
"Language: eng - Script: Latin - Confidence: 0.11450955767632877 - Is reliable: false"
>>> detect("Ceci est écrit en français")
"Language: fra - Script: Latin - Confidence: 0.14716934730038286 - Is reliable: false"
>>> info = detect("Ceci est écrit en français")
>>> info.lang
"fra"
>>> info.script
"Latin"
>>> info.confidence
0.14716934730038286
>>> 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.3.2.tar.gz
(1.3 MB
view hashes)
Built Distributions
Close
Hashes for whatlang_pyo3-0.3.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f6588b47a288c98f901f4e636ac469fd23b9093eb293e0e2676761d4638dd59 |
|
MD5 | 2d64716f4947d4fe8f53920e16204519 |
|
BLAKE2b-256 | 9b7c21426c577796693d4e70d2f3e2a01e44b44f28695839128d470d5f09376a |
Close
Hashes for whatlang_pyo3-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2db61d7e1d06f963c09de93f4fd69a6c4e8352bdf47fc95efc16fc224720dff |
|
MD5 | 10adbacf5ea4675028e11b120575bb5a |
|
BLAKE2b-256 | 36288f5553685b39bb6dee9d2163476e35bbc060d9a9afdd90a168daf1dc4b1b |
Close
Hashes for whatlang_pyo3-0.3.2-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d8714bb9a4cb7444f1ca219e435cc38c1cd16bf116fd0c0624c27be89baf34e |
|
MD5 | 48547561745482ce27dd659362983aab |
|
BLAKE2b-256 | 6cd6621c0e2cbac333f9d0faca5b1b3817d9b55ef090d8493888b0562a689a0c |
Close
Hashes for whatlang_pyo3-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c020bc091abf700b9be242e27eaa2ef5b6176831800f1f17f91e214aba3e0ad9 |
|
MD5 | c00e1418a37cc0d824ba400c929d48ba |
|
BLAKE2b-256 | 67c1d7f37b458af807f6cc922961b78ca113c8f48dcbfc9f8417bc87f650aaa2 |
Close
Hashes for whatlang_pyo3-0.3.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b38c072bb663b5dca4554af919f736ff4db30962ab948d8697e159a6f3ffca1 |
|
MD5 | b91bf17bb726d48f4e46f7e0e57a5d7b |
|
BLAKE2b-256 | a92d824d46fc633cfc20a3819666effc36a332b2277345210394238519dd9eb0 |
Close
Hashes for whatlang_pyo3-0.3.2-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cefcdd905b734f578a6857e5d0714d03b47f7026891faa5e5691b6e3724591ec |
|
MD5 | 37febf5c533fb90180075c3804327d6c |
|
BLAKE2b-256 | a592b8cc4e9f2c22c0fbe1dd471e397043cef9a3b8e4aa66e81506766612242b |
Close
Hashes for whatlang_pyo3-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5169533ee5247690a514279a0113b7065bcee1c80226845c7d671ffdd5682cdc |
|
MD5 | edfcfb11fd14ae2a3e4a764339a2e607 |
|
BLAKE2b-256 | f2a1fb04be88f486ec10b38dec8a3d0242d55ffb7495a8e536c7f276a663aaa4 |
Close
Hashes for whatlang_pyo3-0.3.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 542aa0712dfce694ca8b2622fe4157811363891223d5b1aed06231a1406d1fa0 |
|
MD5 | b8d2a34e05cbf4942dc5cb3eb400ee9b |
|
BLAKE2b-256 | 3c98c3f78191a38f4f8437b08bb0bc228207c2037ce1359fec776925881ec69e |
Close
Hashes for whatlang_pyo3-0.3.2-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ba8ae2a09c02b34de2e78fe359877d2c2b762bc346e234a55aad52379a39d20 |
|
MD5 | 5ca14123b69a3efc419d19c460194f85 |
|
BLAKE2b-256 | d7e45c2b0f4cb1c34a39f0a789562e37198ae527a365214852cecba8f03bcbf2 |
Close
Hashes for whatlang_pyo3-0.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b28ca768d288bca1cf7f357ab796c0bad5bc1781121d3dad450142092bb5d23 |
|
MD5 | 25d11cc8577dc9702fdd17def5da295c |
|
BLAKE2b-256 | c4b570597722955660ec463a2745e2b83efc30fbfcaff1622d588f357c7e6c81 |
Close
Hashes for whatlang_pyo3-0.3.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c37d24b17bbef4431e4a6c860ffc68995bdea0af8f1aae4050d600e6c7c58820 |
|
MD5 | 2c67332a52b19792e4efb584ad82f8c6 |
|
BLAKE2b-256 | fe70b143e639a223149b67d509ef15da6a176706580009e1b8bca43a551ebcbe |
Close
Hashes for whatlang_pyo3-0.3.2-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c40ad4b1d0fcb8b1ea2b95abcdfc45d55468cf5f6c68133a4cd54bad42cbfc1 |
|
MD5 | 9ca4524b3861ee2bd86aefb8e2737492 |
|
BLAKE2b-256 | bb38e7ae0e73d75580f72ca72ac50cf62b0ecf96251c0fbcf60df4c185d8be27 |
Close
Hashes for whatlang_pyo3-0.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e08d19fd5835df9cc2841b55d06f079aeb3bde903ebbb691568e007d9f4975f7 |
|
MD5 | c19815cff13338e05be69953cb1bfdb8 |
|
BLAKE2b-256 | daeca02f51b41a6553accfd19be1bb86644b0cef8dae8f00425bfe5c332c2f40 |
Close
Hashes for whatlang_pyo3-0.3.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e37a11c7e49036f8107f353844ed4f943462bd5a4d49b311bd611395e4e5e906 |
|
MD5 | df4e3939ad176cf36967f89394dea58f |
|
BLAKE2b-256 | 51435aa340c67c5f4dd3970a9d2831cd2e97391252f5b0170a5e9226af47c531 |