urdu-nlp
A lightweight, pure-Python NLP library for Urdu language processing. No deep learning required — just install and go.
Urdu is spoken by 230+ million people, yet has almost no usable NLP tooling on PyPI. urdu-nlp fills that gap with tokenization, stop word removal, normalization, stemming, transliteration, and sentence boundary detection.
Installation
pip install urdu-nlp
Or install from source:
git clone https://github.com/imabd645/urdu-nlp.git
cd urdu-nlp
pip install -e .
Quick Start
1. Tokenization
from urdu_nlp import tokenize
tokenize("میں اسکول جاتا ہوں")
# → ["میں", "اسکول", "جاتا", "ہوں"]
2. Stop Word Removal
from urdu_nlp import remove_stopwords
remove_stopwords(["میں", "اسکول", "جاتا", "ہوں"])
# → ["اسکول", "جاتا"]
3. Normalization
from urdu_nlp import normalize
normalize("ﻛﺮﻧﺎ") # Arabic form
# → "کرنا" # Urdu form
4. Stemming
from urdu_nlp import stem
stem("کتابوں")
# → "کتاب"
5. Roman Urdu → Urdu Script
from urdu_nlp import roman_to_urdu
roman_to_urdu("mein school jata hoon")
# → "میں اسکول جاتا ہوں"
6. Sentence Boundary Detection
from urdu_nlp import sent_tokenize
sent_tokenize("یہ پہلا جملہ ہے۔ یہ دوسرا ہے۔")
# → ["یہ پہلا جملہ ہے۔", "یہ دوسرا ہے۔"]
API Reference
| Function | Description |
|---|---|
tokenize(text) |
Split Urdu text into word tokens |
sent_tokenize(text) |
Split text into sentences |
remove_stopwords(tokens) |
Remove common Urdu stop words from a token list |
normalize(text) |
Normalize Arabic/Urdu character variants and whitespace |
stem(word) |
Strip common Urdu suffixes to get root form |
roman_to_urdu(text) |
Transliterate Roman Urdu to Urdu script |
Dependencies
regex— Unicode-aware pattern matching (the only dependency)
License
MIT
Metadata
Release files for urdu-nlp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| urdu_nlp-0.1.0.tar.gz | 13.4 kB | Without provenance | Details for urdu_nlp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| urdu_nlp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for urdu_nlp-0.1.0-py3-none-any.whl |
Total release size: 26.1 kB
Release files / urdu_nlp-0.1.0.tar.gz
| Download URL | urdu_nlp-0.1.0.tar.gz |
|---|---|
| Size | 13.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6dcd2bf0aa112f8db3af526fc9effb5f9d40cd078055e3959fe7a94d263368f3
|
|
BLAKE2b-256 checksum How to use checksums |
b6e3ab03727d99a933dd49cb8172e2cd7f38ba7a1f153223ae37ce3dbbcf1c78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Release files / urdu_nlp-0.1.0-py3-none-any.whl
| Download URL | urdu_nlp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
26c237496a75e5149ec612736a7357c1862a8580b1126271c953b8bcbb3d4bd5
|
|
BLAKE2b-256 checksum How to use checksums |
18c0632de6e090e5e4fcb6c31c3f648a41712bbf1a35ef0aa6c0dbedfcbbc1ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Security for urdu-nlp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.