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
>>> 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.3.3.tar.gz
(1.3 MB
view hashes)
Built Distributions
Close
Hashes for whatlang_pyo3-0.3.3-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17e86d6ca2163715704a72620fca53c66e3d8bcdc1efe186798a3f55ee2bf68b |
|
MD5 | d16b2d6071e6330cb9c3df31bd7fcd6f |
|
BLAKE2b-256 | 4475aede2efc8bf7667e006ea6c9cabbb0a4f7815aef5407da9afca64c2618b6 |
Close
Hashes for whatlang_pyo3-0.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04aa32bd5dcb350e63ee043d1b0b1e749d19fd37b6dbde9f318065d3746d0a31 |
|
MD5 | 5009a82a6d3315bef4802f5275fe7ab9 |
|
BLAKE2b-256 | 343b3fc1c7a039c8ec79142100e236b560821dfa63efdf8a448f509e21aa31d1 |
Close
Hashes for whatlang_pyo3-0.3.3-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47ad60a073740bb9cf20d6c94f2d9df87b42fddce0f81e19e0e2bc00f54cb043 |
|
MD5 | 9d52a345867ebf58f3ca095cf7ebf303 |
|
BLAKE2b-256 | 0fd0fbb8441eef82e42da99f6da191a31446c9ba6210a6b5bef088c79e9bf68f |
Close
Hashes for whatlang_pyo3-0.3.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5176c79e7f9b57ae71e68eeabf2b6c1fffdbb0632dd9d53d4a5cebd7702769b0 |
|
MD5 | 3815eb11f207d6ce25697754a3d24694 |
|
BLAKE2b-256 | e8934f58be8361be7e6e20ff55b5c04761ec94266e2ac146eae024b1aa879524 |
Close
Hashes for whatlang_pyo3-0.3.3-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9eeeb18a4a5d595e972602ae3e471d6d9f2b8317532998895087928636da643 |
|
MD5 | 45996f7baf7e3e94d8ec576167d1d261 |
|
BLAKE2b-256 | 74407615d619b0fd28b0dd5045f28769164daa82f76c8346ba1c9eb3f8e0bf63 |
Close
Hashes for whatlang_pyo3-0.3.3-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7842bac02f34c37f2cc4fba1bac4a118d1c37713ca3037bbfe39afb928622dfc |
|
MD5 | 7a0d207a62c0de189c7ccd8135057eac |
|
BLAKE2b-256 | f9e0580a7dd17f919c515c7748ab249617cb4da79216afdf1cd3087640a8009d |
Close
Hashes for whatlang_pyo3-0.3.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94de9cfd77e5f789a21e5c62b0c1d1891ceb7dea971d43ca316737ac0dbe0143 |
|
MD5 | 20f7ffe5e7d3e6c1fd22a7b274eff810 |
|
BLAKE2b-256 | 486e40436b03fd2268b8a4fcec1e92e653e15d72378276613c4620b5189cf33f |
Close
Hashes for whatlang_pyo3-0.3.3-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17583a140cfda187c9e4a153878bbf745df42affcd54294a02b19c088029e9e2 |
|
MD5 | 521c7c5b284eff4ed5ca1a38648295b7 |
|
BLAKE2b-256 | ae94778344338bd2730e3e80c73d92b5f837c925c4af29552719242ed8513f32 |
Close
Hashes for whatlang_pyo3-0.3.3-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28deceaa8c99445e38726bec74f93377e2fbfc238004730a29c2b786823717a6 |
|
MD5 | 6f88dfda5d56656aab2e1741ec70e18f |
|
BLAKE2b-256 | 1a6bba6b90b3142bd1c3c9442a695362ea436cf45f33299ebe835f2eacbdee4f |
Close
Hashes for whatlang_pyo3-0.3.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1706f5a5ec3fd5f7936f27ca26595786596c1d95f9b7af1aa0d429809cadb208 |
|
MD5 | c11e5e284c07827f507b356f529cf940 |
|
BLAKE2b-256 | a3e38fbae0280d451523d3609a7f617949c52ee218062922427a4fa7e6d252fe |
Close
Hashes for whatlang_pyo3-0.3.3-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0abbc8983aac05249009bdd854d0b3ef2a78bf02ba12505b763d391d25c2aba5 |
|
MD5 | 0b02e2990cfe4f40ae72f24c2c1f7cab |
|
BLAKE2b-256 | db1434738674df370714ec27d0d034efa20269254909b10009d41327522287dc |
Close
Hashes for whatlang_pyo3-0.3.3-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccb53e62f0c4875dfd1ed4cda64cd9ffc7ef46f7c09ea2dbeedb2963425d479b |
|
MD5 | c7c5330864ba20ffd6bf27a256522993 |
|
BLAKE2b-256 | 99d71d08a6834d1d7011d0a9ad71d822332f123c032d901e02592771ef29d407 |
Close
Hashes for whatlang_pyo3-0.3.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fab0b024868e19d4376b8f1df3baa866ce1c4b86211de4141bc00844f76633e4 |
|
MD5 | aa9d6db8350a218deec1bdb9dcd97189 |
|
BLAKE2b-256 | a31f0a5312541ee1912fc687102d4b4ba3b39fcfe46ba086bcf6a91387720d1b |
Close
Hashes for whatlang_pyo3-0.3.3-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a50c73dda0a605607de1c8c0d9c452d4bf6097f416989402bd9f07f5272d8091 |
|
MD5 | f2e4913dd01bc6b436f2d9292f30a201 |
|
BLAKE2b-256 | e99b5848bb2a7e7e6700e5f86d6c4efa51773ce90c64e50e0a5adf97e16f465e |