{"id":16654417,"url":"https://github.com/ikegami-yukino/python-tr","last_synced_at":"2025-10-08T22:14:51.804Z","repository":{"id":48985205,"uuid":"21677275","full_name":"ikegami-yukino/python-tr","owner":"ikegami-yukino","description":"A Pure-Python implementation of the tr algorithm","archived":false,"fork":false,"pushed_at":"2021-07-02T04:33:09.000Z","size":18,"stargazers_count":14,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-13T09:49:51.224Z","etag":null,"topics":["pure-python","python","text-processing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ikegami-yukino.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-10T03:02:24.000Z","updated_at":"2023-01-06T11:56:38.000Z","dependencies_parsed_at":"2022-09-05T07:40:08.376Z","dependency_job_id":null,"html_url":"https://github.com/ikegami-yukino/python-tr","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikegami-yukino%2Fpython-tr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikegami-yukino%2Fpython-tr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikegami-yukino%2Fpython-tr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikegami-yukino%2Fpython-tr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ikegami-yukino","download_url":"https://codeload.github.com/ikegami-yukino/python-tr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221817030,"owners_count":16885449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pure-python","python","text-processing"],"created_at":"2024-10-12T09:49:43.669Z","updated_at":"2025-10-08T22:14:46.771Z","avatar_url":"https://github.com/ikegami-yukino.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"python-tr\n==========\n\n|travis| |coveralls| |pyversion| |version| |landscape| |license|\n\n\nThis module is a Python implementation of the tr algorithm.\n\ntr(string1, string2, source, option='')\n\nIf not given option, then replace all characters in string1 with\nthe character in the same position in string2.\n\nFollowing options are available:\n\n\nc\n    Replace all complemented characters in string1 with the character in the same position in string2.\nd\n    Delete all characters in string1.\ns\n    Squeeze all characters in string1.\ncs\n    Squeeze all the characters in string2 besides \"c\" replacement.\nds\n    Delete all characters in string1. Squeeze all characters in string2.\ncd\n    Delete all complemented characters in string1.\n\n\nParams:\n - \u003cunicode\u003e string1\n - \u003cunicode\u003e string2\n - \u003cunicode\u003e source\n - \u003cbasestring\u003e option\nReturn:\n - \u003cunicode\u003e translated_source\n\n\nNote\n===========\n- If Python2.x, the type of paramaters (string1, string2 and source) must be unicode.\n- If Python3.3 or later, the type of paramaters (string1, string2 and source) must be str.\n\nInstallation\n==============\n\n::\n\n  pip install python-tr\n\n\nExample\n===========\nPython2.x\n\n.. code:: python\n\n    from tr import tr\n    tr(u'bn', u'cr', u'bunny')\n    # =\u003e u'curry'\n    tr(u'n', '', u'bunny', 'd')\n    # =\u003e u'buy'\n    tr(u'n', u'u', u'bunny', 'c')\n    # =\u003e u'uunnu'\n    tr(u'n', u'', u'bunny', 's')\n    # =\u003e u'buny'\n    tr(u'bn', '', u'bunny', 'cd')\n    # =\u003e u'bnn'\n    tr(u'bn', u'cr', u'bunny', 'cs')\n    # =\u003e u'brnnr'\n    tr(u'bn', u'cr', u'bunny', 'ds')\n    # =\u003e u'uy'\n\n\nPython3.3 or later\n\n.. code:: python\n\n    from tr import tr\n    tr('bn', 'cr', 'bunny')\n    # =\u003e 'curry'\n    tr('n', '', 'bunny', 'd')\n    # =\u003e 'buy'\n    tr('n', 'u', 'bunny', 'c')\n    # =\u003e 'uunnu'\n    tr('n', '', 'bunny', 's')\n    # =\u003e 'buny'\n    tr('bn', '', 'bunny', 'cd')\n    # =\u003e 'bnn'\n    tr('bn', 'cr', 'bunny', 'cs')\n    # =\u003e 'brnnr'\n    tr('bn', 'cr', 'bunny', 'ds')\n    # =\u003e 'uy'\n\n\nContributions are welcome.\n\n\n.. |travis| image:: https://travis-ci.org/ikegami-yukino/python-tr.svg?branch=master\n    :target: https://travis-ci.org/ikegami-yukino/python-tr\n    :alt: travis-ci.org\n\n.. |coveralls| image:: https://coveralls.io/repos/ikegami-yukino/python-tr/badge.svg?branch=master\u0026service=github\n    :target: https://coveralls.io/github/ikegami-yukino/python-tr?branch=master\n    :alt: coveralls.io\n\n.. |version| image:: https://img.shields.io/pypi/v/python-tr.svg\n    :target: http://pypi.python.org/pypi/python-tr/\n    :alt: latest version\n\n.. |pyversion| image:: https://img.shields.io/pypi/pyversions/python-tr.svg\n\n.. |landscape| image:: https://landscape.io/github/ikegami-yukino/python-tr/master/landscape.svg?style=flat\n   :target: https://landscape.io/github/ikegami-yukino/python-tr/master\n   :alt: Code Health\n\n.. |license| image:: https://img.shields.io/pypi/l/python-tr.svg\n    :target: http://pypi.python.org/pypi/python-tr/\n    :alt: license\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fikegami-yukino%2Fpython-tr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fikegami-yukino%2Fpython-tr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fikegami-yukino%2Fpython-tr/lists"}