pyunycode


Namepyunycode JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/Yutsuro/pyunycode
SummaryPunycode Converter Library for Python
upload_time2023-03-26 17:27:46
maintainer
docs_urlNone
authorYutsuro
requires_python
licenseMIT
keywords punycode converter python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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



```sh

pip install pyunycode

```



### Code sample



```python

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

```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Yutsuro/pyunycode",
    "name": "pyunycode",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Punycode Converter Python",
    "author": "Yutsuro",
    "author_email": "Yuki@utsu.ro",
    "download_url": "https://files.pythonhosted.org/packages/00/b5/4cd123212b9f15c644d9663748c14cce8f61b0916ef76692f690b8da2a50/pyunycode-0.1.1.tar.gz",
    "platform": null,
    "description": "# pyunycode\r\n\r\n\r\n\r\n**Punycode Converter Library for Python**\r\n\r\n\r\n\r\nYou can convert Punycode domain to/from Unicode domain with only one function: `pyunycode.convert`.\r\n\r\n\r\n\r\n## How to use\r\n\r\n\r\n\r\n### Install\r\n\r\n\r\n\r\n```sh\r\n\r\npip install pyunycode\r\n\r\n```\r\n\r\n\r\n\r\n### Code sample\r\n\r\n\r\n\r\n```python\r\n\r\nimport pyunycode\r\n\r\n\r\n\r\n# Convert Unicode domain to Punycode domain\r\n\r\nstr1 = \"\u7f8e\u3057\u3044.\u4e16\u754c\"\r\n\r\nstr2 = \"\u3053\u3063\u3061.\u307f\u3093\u306a\"\r\n\r\nstr3 = \"\u65e5\u672c\u8a9e.jp\"\r\n\r\nprint(f\"{str1} -> {pyunycode.convert(str1)}\")\r\n\r\nprint(f\"{str2} -> {pyunycode.convert(str2)}\")\r\n\r\nprint(f\"{str3} -> {pyunycode.convert(str3)}\")\r\n\r\n\r\n\r\n# \u50d5\u3060\u3051\u306e.\u4e16\u754c -> xn--08j3a5b142t.xn--rhqv96g\r\n\r\n# \u3053\u3063\u3061.\u307f\u3093\u306a -> xn--l8j9flb8a.xn--q9jyb4c\r\n\r\n# \u65e5\u672c\u8a9e.jp -> xn--wgv71a119e.jp\r\n\r\n\r\n\r\n# Punycode domain to Unicode domain\r\n\r\nstr4 = \"xn--n8jub8754b.xn--rhqv96g\"\r\n\r\nstr5 = \"xn--28j2af.xn--q9jyb4c\"\r\n\r\nstr6 = \"xn--wgv71a119e.jp\"\r\n\r\nprint(f\"{str4} -> {pyunycode.convert(str4)}\")\r\n\r\nprint(f\"{str5} -> {pyunycode.convert(str5)}\")\r\n\r\nprint(f\"{str6} -> {pyunycode.convert(str6)}\")\r\n\r\n\r\n\r\n# xn--n8jub8754b.xn--rhqv96g -> \u7f8e\u3057\u3044.\u4e16\u754c\r\n\r\n# xn--28j2af.xn--q9jyb4c -> \u3053\u3063\u3061.\u307f\u3093\u306a\r\n\r\n# xn--wgv71a119e.jp -> \u65e5\u672c\u8a9e.jp\r\n\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Punycode Converter Library for Python",
    "version": "0.1.1",
    "split_keywords": [
        "punycode",
        "converter",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0f1377dd86108d48c1811c6a08549739f13be6fa06e78093e7497717d5cfe781",
                "md5": "720553459ec9f360fec9e700e8925883",
                "sha256": "267472bdab029643397df279305bff81879e03b939988f561ee1215a70fda834"
            },
            "downloads": -1,
            "filename": "pyunycode-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "720553459ec9f360fec9e700e8925883",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3220,
            "upload_time": "2023-03-26T17:27:44",
            "upload_time_iso_8601": "2023-03-26T17:27:44.473224Z",
            "url": "https://files.pythonhosted.org/packages/0f/13/77dd86108d48c1811c6a08549739f13be6fa06e78093e7497717d5cfe781/pyunycode-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "00b54cd123212b9f15c644d9663748c14cce8f61b0916ef76692f690b8da2a50",
                "md5": "a8d39d097bb96346307341022f0dea61",
                "sha256": "bfb0fbe9b32f647f0989e38f4750e538fb41707f109c8773ff24b78c71cdb00e"
            },
            "downloads": -1,
            "filename": "pyunycode-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a8d39d097bb96346307341022f0dea61",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3874,
            "upload_time": "2023-03-26T17:27:46",
            "upload_time_iso_8601": "2023-03-26T17:27:46.733793Z",
            "url": "https://files.pythonhosted.org/packages/00/b5/4cd123212b9f15c644d9663748c14cce8f61b0916ef76692f690b8da2a50/pyunycode-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-26 17:27:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Yutsuro",
    "github_project": "pyunycode",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "pyunycode"
}
        
Elapsed time: 0.10850s