Legacy Nepali font to Unicode converter with PDF rescue
Project description
nepali-converter
Convert legacy Nepali font encodings (Preeti, Kantipur, Sagarmatha, Himalb) to Unicode Devanagari. Also rescues legacy-encoded text from PDFs (non-OCR).
Part of the nepali-fonts project.
Installation
pip install nepali-converter
For PDF rescue support:
pip install nepali-converter[pdf]
CLI usage
Convert a legacy-encoded text file:
nepali-convert input.txt --font preeti --output output.txt
Auto-detect the legacy font:
nepali-convert input.txt --output output.txt
Read from stdin:
echo "g]kfn" | nepali-convert - --font preeti
Rescue text from a legacy-font PDF:
nepali-convert --pdf document.pdf --output rescued.txt
nepali-convert --pdf document.pdf --pages 1-5 --output rescued.txt
Python API
from nepali_converter import convert, detect_font
# Convert with a known font
text = convert("g]kfn", "preeti") # → "नेपाल"
# Auto-detect the font
font = detect_font(legacy_text)
if font:
text = convert(legacy_text, font)
# Rescue text from a PDF (requires nepali-converter[pdf])
from nepali_converter import rescue_pdf
rescued = rescue_pdf("document.pdf", pages=(1, 10))
Supported fonts
| Font | Encoding |
|---|---|
| Preeti | Windows-1252 (cp1252) |
| Kantipur | Windows-1252 (cp1252) |
| Sagarmatha | Windows-1252 (cp1252) |
| Himalb (Fontasy Himali TT) | Windows-1252 (cp1252) |
License
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nepali_converter-0.1.0.tar.gz.
File metadata
- Download URL: nepali_converter-0.1.0.tar.gz
- Upload date:
- Size: 20.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
287c36587631bcad3a8959bd2bdf09ecbece9ca8edd2367d30ebfb18b5fd2541
|
|
| MD5 |
44a2c5f421e45a27071e6b5c027e1fea
|
|
| BLAKE2b-256 |
e52375f23e4ecaa7a9cc557cffcc8639bd2ab968b20d0128a6da927686f53102
|
File details
Details for the file nepali_converter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nepali_converter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b6d9cca5b05d746d6921c85b2a1c9e4b7a7405d836391dad57493abd21d266c
|
|
| MD5 |
68d01a916a81190f64d99987c63b414b
|
|
| BLAKE2b-256 |
12876e746575e8482c0ed3f9527656b354ed8f7e3363d2ad85a5dba31b703c44
|