handright


Namehandright JSON
Version 8.2.0 PyPI version JSON
download
home_pagehttps://github.com/Gsllchb/Handright
SummaryA lightweight Python library for simulating Chinese handwriting
upload_time2023-08-19 04:28:22
maintainer
docs_urlNone
authorChenghui Li (Gsllchb)
requires_python>= 3.8
licensebsd-3-clause
keywords simulating chinese handwriting
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Handright
___A lightweight Python library for simulating Chinese handwriting___

[![released version](https://img.shields.io/pypi/v/Handright.svg)][pypi]
[![python version](https://img.shields.io/pypi/pyversions/Handright.svg)][pypi]
[![license](https://img.shields.io/github/license/Gsllchb/Handright.svg)][license]

[Tutorial][tutorial] |
[Release Notes][release-notes] |
[Contributing][contributing]

![](docs/images/slogan.png)

## Vision
Reveal the nature of Chinese handwriting and use it to implement beautiful, simple and easy-to-use interfaces.

## Algorithm
首先,在水平位置、竖直位置和字体大小三个自由度上,对每个字的整体做随机扰动。随后,在水平位置、竖直位置和旋转角度三个自由度上,对每个字的每个笔画做随机扰动。

## Installation
```console
pip install handright
```

## Quick Start
```python
# coding: utf-8
from PIL import Image, ImageFont

from handright import Template, handwrite

text = "我能吞下玻璃而不伤身体。"
template = Template(
    background=Image.new(mode="1", size=(1024, 2048), color=1),
    font=ImageFont.truetype("path/to/my/font.ttf", size=100),
)
images = handwrite(text, template)
for im in images:
    assert isinstance(im, Image.Image)
    im.show()

```
更多信息请参阅[Tutorial][tutorial]。


## Join Us
扫码或点击[链接](https://t.zsxq.com/zzZfMJq)加入Handright社区,关于Handright的使用问题请优先在社区中咨询:
![手右](docs/images/zsxq.png)


[tutorial]: docs/tutorial.md
[PIL]: http://www.pythonware.com/products/pil/
[Pillow]: http://python-pillow.org/
[release-notes]: docs/release_notes.md
[pypi]: https://pypi.org/project/handright/
[license]: LICENSE.txt
[contributing]: .github/CONTRIBUTING.md



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Gsllchb/Handright",
    "name": "handright",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">= 3.8",
    "maintainer_email": "",
    "keywords": "simulating Chinese handwriting",
    "author": "Chenghui Li (Gsllchb)",
    "author_email": "Gsllchb@qq.com",
    "download_url": "https://files.pythonhosted.org/packages/d6/b0/3232ad249f8a627d38be39e4839803f9b8e8f428cf9f0fbaf69e66d42897/handright-8.2.0.tar.gz",
    "platform": null,
    "description": "# Handright\n___A lightweight Python library for simulating Chinese handwriting___\n\n[![released version](https://img.shields.io/pypi/v/Handright.svg)][pypi]\n[![python version](https://img.shields.io/pypi/pyversions/Handright.svg)][pypi]\n[![license](https://img.shields.io/github/license/Gsllchb/Handright.svg)][license]\n\n[Tutorial][tutorial] |\n[Release Notes][release-notes] |\n[Contributing][contributing]\n\n![](docs/images/slogan.png)\n\n## Vision\nReveal the nature of Chinese handwriting and use it to implement beautiful, simple and easy-to-use interfaces.\n\n## Algorithm\n\u9996\u5148\uff0c\u5728\u6c34\u5e73\u4f4d\u7f6e\u3001\u7ad6\u76f4\u4f4d\u7f6e\u548c\u5b57\u4f53\u5927\u5c0f\u4e09\u4e2a\u81ea\u7531\u5ea6\u4e0a\uff0c\u5bf9\u6bcf\u4e2a\u5b57\u7684\u6574\u4f53\u505a\u968f\u673a\u6270\u52a8\u3002\u968f\u540e\uff0c\u5728\u6c34\u5e73\u4f4d\u7f6e\u3001\u7ad6\u76f4\u4f4d\u7f6e\u548c\u65cb\u8f6c\u89d2\u5ea6\u4e09\u4e2a\u81ea\u7531\u5ea6\u4e0a\uff0c\u5bf9\u6bcf\u4e2a\u5b57\u7684\u6bcf\u4e2a\u7b14\u753b\u505a\u968f\u673a\u6270\u52a8\u3002\n\n## Installation\n```console\npip install handright\n```\n\n## Quick Start\n```python\n# coding: utf-8\nfrom PIL import Image, ImageFont\n\nfrom handright import Template, handwrite\n\ntext = \"\u6211\u80fd\u541e\u4e0b\u73bb\u7483\u800c\u4e0d\u4f24\u8eab\u4f53\u3002\"\ntemplate = Template(\n    background=Image.new(mode=\"1\", size=(1024, 2048), color=1),\n    font=ImageFont.truetype(\"path/to/my/font.ttf\", size=100),\n)\nimages = handwrite(text, template)\nfor im in images:\n    assert isinstance(im, Image.Image)\n    im.show()\n\n```\n\u66f4\u591a\u4fe1\u606f\u8bf7\u53c2\u9605[Tutorial][tutorial]\u3002\n\n\n## Join Us\n\u626b\u7801\u6216\u70b9\u51fb[\u94fe\u63a5](https://t.zsxq.com/zzZfMJq)\u52a0\u5165Handright\u793e\u533a\uff0c\u5173\u4e8eHandright\u7684\u4f7f\u7528\u95ee\u9898\u8bf7\u4f18\u5148\u5728\u793e\u533a\u4e2d\u54a8\u8be2\uff1a\n![\u624b\u53f3](docs/images/zsxq.png)\n\n\n[tutorial]: docs/tutorial.md\n[PIL]: http://www.pythonware.com/products/pil/\n[Pillow]: http://python-pillow.org/\n[release-notes]: docs/release_notes.md\n[pypi]: https://pypi.org/project/handright/\n[license]: LICENSE.txt\n[contributing]: .github/CONTRIBUTING.md\n\n\n",
    "bugtrack_url": null,
    "license": "bsd-3-clause",
    "summary": "A lightweight Python library for simulating Chinese handwriting",
    "version": "8.2.0",
    "project_urls": {
        "Homepage": "https://github.com/Gsllchb/Handright"
    },
    "split_keywords": [
        "simulating",
        "chinese",
        "handwriting"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "40001c5e1751c2b986b3408ef6df21c7c412d14de84cf5a7dc029774afae8a60",
                "md5": "63f90bbd553f5774a4c23d44783aaa28",
                "sha256": "aad7f7eb2539750ad7270cd160920258d252f0ba8216747eb48dbac95fb4fbf2"
            },
            "downloads": -1,
            "filename": "handright-8.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "63f90bbd553f5774a4c23d44783aaa28",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">= 3.8",
            "size": 11876,
            "upload_time": "2023-08-19T04:28:20",
            "upload_time_iso_8601": "2023-08-19T04:28:20.572684Z",
            "url": "https://files.pythonhosted.org/packages/40/00/1c5e1751c2b986b3408ef6df21c7c412d14de84cf5a7dc029774afae8a60/handright-8.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d6b03232ad249f8a627d38be39e4839803f9b8e8f428cf9f0fbaf69e66d42897",
                "md5": "776c167319f39915ff4cf5d91a29e9ce",
                "sha256": "644c02506b877c15a8f0fd9e7b884ef118fb8d50c034ef58e0392d01f71ab352"
            },
            "downloads": -1,
            "filename": "handright-8.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "776c167319f39915ff4cf5d91a29e9ce",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">= 3.8",
            "size": 12451,
            "upload_time": "2023-08-19T04:28:22",
            "upload_time_iso_8601": "2023-08-19T04:28:22.428204Z",
            "url": "https://files.pythonhosted.org/packages/d6/b0/3232ad249f8a627d38be39e4839803f9b8e8f428cf9f0fbaf69e66d42897/handright-8.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-19 04:28:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Gsllchb",
    "github_project": "Handright",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "handright"
}
        
Elapsed time: 0.10885s