Skip to main content

Utility functions to manipulate Japanese texts.

Requirements

  • Python 3.3 or later

Functions

guess(s)

文字列 s のエンコーディングを推測する。戻り値は UNKNOWN, ASCII, SJIS, EUC, JIS, UTF8, UTF16_LE, UTF16_BE のいずれかとなる。 UTF16_LE と UTF16_BE は、文字列の先頭にBOMが付与されている場合のみ検出される。

sjistojis(s), sjistoeuc(s), euctosjis(s), euctojis(s), jistosjis(s), jistoeuc(s)

文字列 s を、異なるエンコーディングに変更する。

kanatohalf(ustr), kanatofull(ustr)

Unicode文字列 ustr に含まれるカタカナ・句読点等を、半角<->全角に変換する。

tohalf(ustr), tofull(ustr)

Unicode文字列 ustr に含まれるカタカナ・句読点等以外の、cp932に含まれる文字を、半角<->全角に変換する。

getnengo(y, m, d, letter=False)

y年m月d日の年号と年のタプルを返す。letter=Trueの場合は年号としてH/S/T/Mのいずれかを返す。

heiseitoyear(y), showatoyear(y), taishoyear(y), meijitoyear(y)

平成、昭和、大正、明治の年から、西暦を返す。

wrap(ustr, maxcol)

Unicode文字列 ustr を、maxcol桁の文字列に分割する。ワードラップ・行頭禁則対応。

Metadata

Release files for pyjf3 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyjf3 0.3
File Size Uploaded
pyjf3-0.3.tar.gz 14.1 kB Details

Release files / pyjf3-0.3.tar.gz

Download URL pyjf3-0.3.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4b179a74a636ec7c8d98d2f9c84205fc15de5b1fb34ff397c592ca32d43ddb6b
BLAKE2b-256 checksum
How to use checksums
086fdfba84513e7b86e36d21f34141fd6430236781a098f87fa0fe636a4fc3a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3 This release

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page