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
>>> from whatlang import detect_lang
>>> detect_lang("This is written in English")
"eng"
>>> detect_lang("Ceci est écrit en français")
"fra"
Detect script
>>> 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']
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.0.tar.gz
(1.3 MB
view hashes)
Built Distributions
Close
Hashes for whatlang_pyo3-0.3.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 365ba22ed1730ebeb889b518a07f4bd6b2e63618a12f948e7eabf82694583ea6 |
|
MD5 | e4a09c7b6bd138d995a777d53af40917 |
|
BLAKE2b-256 | 5aeb88d7527aff2d217eebea3f331c71ee283d5fcf34db82ebbf83c51e10885e |
Close
Hashes for whatlang_pyo3-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f58bfa5ce57def302f3cb39ce66ee4ac3a0ae0ad770a81d25f79c5207570b8a1 |
|
MD5 | 8f28c7feea5dbc7e0e71c1d1f8da7ea2 |
|
BLAKE2b-256 | 767e75332494a074d0eee07b5e657db29eeaf89e148be1fc0abd373a84dd28a9 |
Close
Hashes for whatlang_pyo3-0.3.0-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96c2542670a90aeab38e6fede4382779f105f5d44b96a192ee4a1c2dca11774a |
|
MD5 | 86e3fbad064947b43abfb84daf5e7794 |
|
BLAKE2b-256 | cf9ee1bef004162df8b814c480f10b0ddec04b05a02610e4b04e3d38dc194891 |
Close
Hashes for whatlang_pyo3-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f74b0ec2b05ccf44de57b944aa7975872d4836a26165414f51ab2f5533fa4fd |
|
MD5 | f214994078329afc50380611647f89e1 |
|
BLAKE2b-256 | 922ea4d4b8d20930e34d745705c3e3d72c812b58c9590fc469ae384adfdf12d3 |
Close
Hashes for whatlang_pyo3-0.3.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa77f7505c5213e5616e747dec1592d8fb63b271dac9dde37380367aa921a0fe |
|
MD5 | eea43d092871ce29ca42daa768fe25a5 |
|
BLAKE2b-256 | c508c959cf5ec7900460eaa932aa8c4d53e546279dc5bc6b40ccf334b044aed1 |
Close
Hashes for whatlang_pyo3-0.3.0-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16284c6643959620abcef2c2c6503abe3a5de907301ee9948360b81cab7840fd |
|
MD5 | 76ca3f7b52deb388bcbe6697b011d790 |
|
BLAKE2b-256 | 8ea73df71c0c3e62527d925d5d024525d5d908ca5c5da44aaeb0ac56f26159a9 |
Close
Hashes for whatlang_pyo3-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 548e157dc477f5bc6e49ae607eb7d5fd8493e3067f89729bce3360d51293d905 |
|
MD5 | 84aa5d23bcbbf1a7479566dfedb2fee8 |
|
BLAKE2b-256 | c5f4b7022fdaaf08b89c047f4678cbe4cd13301ae3545c562d4d0d497dd5a966 |
Close
Hashes for whatlang_pyo3-0.3.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2baa78cf0f85a3e8361804315516f2ddff6de09450f81b9a2d0cb797efdab80a |
|
MD5 | 041cc080971c6c487c7fa0be9b883456 |
|
BLAKE2b-256 | b8605a4d75d56bc466c14c357ed61e2e3f602aac80543e5ab5938421178f4ab7 |
Close
Hashes for whatlang_pyo3-0.3.0-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 939183ad62fd6a5793b2f783efd2ae295ead1a0ae3786d54fa92314314c422af |
|
MD5 | 3dbcb465c64f939901b3942c42f624c7 |
|
BLAKE2b-256 | 783898979f28ffad735013cd615b6cfaca32bf996242d30e9b0277234d0a0514 |
Close
Hashes for whatlang_pyo3-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9129f72afd9328402ae5b251bb58a041bb6f624df3a9ab0de0112be8e324920 |
|
MD5 | 999cab42795118a6799dbf52ee9e94fe |
|
BLAKE2b-256 | 65d38e1d8972b28bcc66e59097d617deb598e5968708de6fb870e65d0ec84458 |
Close
Hashes for whatlang_pyo3-0.3.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a510950c5129b528bbed399741db4e36a6c29412fc206e20dcde8000638d7227 |
|
MD5 | b3d1d66aa78d2f4e07eb45fc366ec078 |
|
BLAKE2b-256 | 04ac535289f84250f69926efaecf9ca0ef9fecb42cac6bf6868ca805e6a51385 |
Close
Hashes for whatlang_pyo3-0.3.0-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4fe2885794891d0c323d4ba996e0d0ab4c8890b3bfae08d50d40f3e7d15432d |
|
MD5 | 729d2407b357a79e7b09caa732b7f3b3 |
|
BLAKE2b-256 | 60a30952586d7bc8c2e2e8ae9d52428e0c7096c1514cc8ab2d5565cfea2c602e |
Close
Hashes for whatlang_pyo3-0.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbb37e66a1cb5169085564143e6d407724c63a4d4ab146fce10d976a8485b176 |
|
MD5 | 89f9182fb54e4391689f45c5c1c38d40 |
|
BLAKE2b-256 | d4976f11be590764a0bc05dc3f258cf9af417d7a13fa3ab9fb7e707e70869aff |
Close
Hashes for whatlang_pyo3-0.3.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc79792bf98836de0f53b2ea7981f3514d9de873fc8751e4a754e17cd3221f14 |
|
MD5 | 29d727cec35659d6409f70af0aa3c7b9 |
|
BLAKE2b-256 | 27cfbe5a5160ac5e40e4a81e7ee5bc6c2a0b58995507989f1b10cb560a12c069 |