Skip to main content

pyunycode

Punycode Converter Library for Python

You can convert Punycode domain to/from Unicode domain with only one function: pyunycode.convert.

How to use

Install

pip install pyunycode

Code sample

import pyunycode



# Convert Unicode domain to Punycode domain

str1 = "美しい.世界"

str2 = "こっち.みんな"

str3 = "日本語.jp"

print(f"{str1} -> {pyunycode.convert(str1)}")

print(f"{str2} -> {pyunycode.convert(str2)}")

print(f"{str3} -> {pyunycode.convert(str3)}")



# 僕だけの.世界 -> xn--08j3a5b142t.xn--rhqv96g

# こっち.みんな -> xn--l8j9flb8a.xn--q9jyb4c

# 日本語.jp -> xn--wgv71a119e.jp



# Punycode domain to Unicode domain

str4 = "xn--n8jub8754b.xn--rhqv96g"

str5 = "xn--28j2af.xn--q9jyb4c"

str6 = "xn--wgv71a119e.jp"

print(f"{str4} -> {pyunycode.convert(str4)}")

print(f"{str5} -> {pyunycode.convert(str5)}")

print(f"{str6} -> {pyunycode.convert(str6)}")



# xn--n8jub8754b.xn--rhqv96g -> 美しい.世界

# xn--28j2af.xn--q9jyb4c -> こっち.みんな

# xn--wgv71a119e.jp -> 日本語.jp

Release files for pyunycode 0.1.1

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

Source distribution (sdist)

Source distribution for pyunycode 0.1.1
File Size Uploaded
pyunycode-0.1.1.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyunycode 0.1.1
File Interpreter ABI Platform
pyunycode-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / pyunycode-0.1.1.tar.gz

Download URL pyunycode-0.1.1.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bfb0fbe9b32f647f0989e38f4750e538fb41707f109c8773ff24b78c71cdb00e
BLAKE2b-256 checksum
How to use checksums
00b54cd123212b9f15c644d9663748c14cce8f61b0916ef76692f690b8da2a50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.8

Release files / pyunycode-0.1.1-py3-none-any.whl

Download URL pyunycode-0.1.1-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
267472bdab029643397df279305bff81879e03b939988f561ee1215a70fda834
BLAKE2b-256 checksum
How to use checksums
0f1377dd86108d48c1811c6a08549739f13be6fa06e78093e7497717d5cfe781
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.8

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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