Skip to main content

Python Interface to NKF

Project description

Python Interface to NKF (Network Kanji Filter)

How to Install

Install from PyPI:

$ sudo pip install nkf

Install from source tree:

$ make
$ sudo make install

Usage

## flag is same as the flags of nkf itself
import nkf
output = nkf.nkf(flag, input)

## For example, to convert from euc-jp to utf-8
output = nkf.nkf('-Ew', 'some euc-jp string')

## Guess character encoding
input_encoding = nkf.guess('some string')

guess() function guesses an input string encoding and returns one of next strings:

  • BINARY
  • ASCII
  • Shift_JIS
  • CP932
  • EUC-JP
  • EUCJP-MS
  • CP51932
  • ISO-2022-JP
  • CP50221
  • CP50220
  • UTF-8
  • UTF-16
  • UTF-32

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

nkf-1.0.4.tar.gz (183.0 kB view details)

Uploaded Source

File details

Details for the file nkf-1.0.4.tar.gz.

File metadata

  • Download URL: nkf-1.0.4.tar.gz
  • Upload date:
  • Size: 183.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.12.4 CPython/3.11.8

File hashes

Hashes for nkf-1.0.4.tar.gz
Algorithm Hash digest
SHA256 7eda1424883d351ae8f28ada4ca6cf423ec47c63745d83d4c0c6b8817192b601
MD5 f0ad672b2d6e90630f266fe0de8ce041
BLAKE2b-256 ccf68cfefbc6b443fbfd87fb8e0bfa78e4c339d608f9968a1fca5b15969489b7

See more details on using hashes here.

Supported by

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