Skip to main content

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).

Package size: 15 kB (wheel) / 20 kB (sdist)

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nepali_converter-0.1.1.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nepali_converter-0.1.1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file nepali_converter-0.1.1.tar.gz.

File metadata

  • Download URL: nepali_converter-0.1.1.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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

Hashes for nepali_converter-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1d2f4e000bb9b7a583bffdfcc616181a7c185541d45090f6c1bcd24551a42111
MD5 c9b040e49434663b423e024dabc1b6fd
BLAKE2b-256 7c0b2fd90dc4e103e069e799a47abad61be2ad38eb1375023e26acf222cdbf9a

See more details on using hashes here.

File details

Details for the file nepali_converter-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nepali_converter-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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

Hashes for nepali_converter-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9a7f1f0e607bb25866003f674b24caf1ac8e0b0054583754ffd4cbc971a148c6
MD5 c74310676205f3c6f7b9f238a6875fd0
BLAKE2b-256 0445ebea8882118cfb61783dcd20be59e69279bd10743f102ab7f3a37e823dc0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page