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.1.tar.gz
(1.3 MB
view hashes)
Built Distributions
Close
Hashes for whatlang_pyo3-0.3.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c3562f8b2014c382161495dfdfef245dbe40a6b44a40e8bdec6be0bcc72bd10 |
|
MD5 | 7f6f05a8e9950ce317a18be57fe6ad51 |
|
BLAKE2b-256 | bfbe7a20f98cc3e591261991fc8c5704398163cedd1ec5fd591b8cf8db9fb196 |
Close
Hashes for whatlang_pyo3-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e9752c13c64c08c570e6e3c5b846e23d66bd92e88c04b4884dcf7a7c312b369 |
|
MD5 | 99e85f0420d8fbe8af87ff32c0a34038 |
|
BLAKE2b-256 | 2b293cb61cc7efd63a7b5dd6f060ad118154eaeee3682632187236c40e99f647 |
Close
Hashes for whatlang_pyo3-0.3.1-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ad1e4863b707322e4a1211336d490389082ea00504f9e9ff5c1cc986bb26659 |
|
MD5 | 023a8c144fcdacff25f75b5a5e288767 |
|
BLAKE2b-256 | b34b8f09e9bf4b7c334cb08e2ab0f0597ab11c760bb48831cc54d5e81c78d961 |
Close
Hashes for whatlang_pyo3-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16cf1c0c967aeb05815b794c20c701d194b2d0449a3a24740b3139e846692b28 |
|
MD5 | 3d473d0b26337563afe507e75b227e7f |
|
BLAKE2b-256 | 9aa365c26823c394eaa2f5dc8553eb188d171a5a5ea0ac8981c17d109166df60 |
Close
Hashes for whatlang_pyo3-0.3.1-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25dc30570fc1e4b966d7a4c53479003c200d088d29c386821d5d75ed058ecef5 |
|
MD5 | 0864c2ed800a2b88ef46b293fc9cfbd6 |
|
BLAKE2b-256 | f977341bad4edd678ab99d627b5c8f271cb3888a73ca352fcc8e2af41526fafd |
Close
Hashes for whatlang_pyo3-0.3.1-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0f0403af96a08474c3dd1ea924a15350bb4e40106b1b113d26a70a89c3b4dcd |
|
MD5 | 3926c24b8e3f3554f0fc1af7b8cd5753 |
|
BLAKE2b-256 | 1c83c643604c69c054b90ffd3482cc37633eff3b588a7e467c55e9eb4aff8248 |
Close
Hashes for whatlang_pyo3-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8cd6e404ef5afc725ded953b5efa464a2aa48f6969abee2a29dafd1041b1eb4 |
|
MD5 | 3384d08541160efacba770a82d3e7781 |
|
BLAKE2b-256 | dc0d1017b4e8ccd62fa6eb76631bfec665103b83d4fcb95149c5812673e63116 |
Close
Hashes for whatlang_pyo3-0.3.1-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c0ca3b1ebba2e65274aa90db1d136716f74ef629d1bc6fada02fe1cc52e87ab |
|
MD5 | 8c0dfed2adf6cfcd54fc2851893ebca6 |
|
BLAKE2b-256 | 19066fbfdc57d912d31b7e8c7c0eae70055f0bb9366039aefe52dd0031c54b00 |
Close
Hashes for whatlang_pyo3-0.3.1-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a701974eea9c0221a1a290245656e19738ecdeff34844cce799636b9cb56b87 |
|
MD5 | 9d864ec121b8d7038d3db06d14be0651 |
|
BLAKE2b-256 | e3fde6cc25b9296a4a17f13e7de983de90fe847b797a33634087d88cf32f53f9 |
Close
Hashes for whatlang_pyo3-0.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7eb0650a5aab998a123a3125bedd505f2730d821cbc5c3d127e496b0755c93b0 |
|
MD5 | b4b175361f15303f59f614eee2f3976f |
|
BLAKE2b-256 | 205f11d23b548665fefe97bae16cf250d63bdb81f56d36ba895b9e8008a1be2b |
Close
Hashes for whatlang_pyo3-0.3.1-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcfdd701c325a2a75741c5c6da38b48b40d8dee74a0d1352b1c19dca8292f8dd |
|
MD5 | 50d1b3e448f748192154b5ad09446eec |
|
BLAKE2b-256 | 7f774c41691a39e418c3191876ff0ec911908d9ec48094a419784380691f91c5 |
Close
Hashes for whatlang_pyo3-0.3.1-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91403f380159dc84063da6a53140c30f561edc68b700dd5cb525d071df5cd079 |
|
MD5 | f0845209ef6176918feb81eff499b740 |
|
BLAKE2b-256 | 01711be900da45e29509642687f4efa5414c9f27542130bc83ab4adaf50754e4 |
Close
Hashes for whatlang_pyo3-0.3.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4777288f17bf40fedb3ee2e988983b72b775835a3311b9fe917bbe80396c29f1 |
|
MD5 | 097a4601fb4adbb99b01ebc9b88d6be6 |
|
BLAKE2b-256 | 48cc5459e9ea4fdd167e4c012cd19832e8393ad60d3740a4df04f9af51c67c6f |
Close
Hashes for whatlang_pyo3-0.3.1-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 162bd94d8184ecff5928578ee460c4f411eb807617d8deedc0c654cc879fe23a |
|
MD5 | 9103e3f69cd923c4a4ac98eca5a1534f |
|
BLAKE2b-256 | 72a16a2b0d43b8f5a28b4f63111bb78497d7629cfeab7b2c4dc6a3691eae9408 |