py2ren


Namepy2ren JSON
Version 1.0 PyPI version JSON
download
home_pageNone
SummaryA tool to automate the transformation of native python code to renpy code.
upload_time2025-01-14 18:59:33
maintainerNone
docs_urlNone
authorNone
requires_python>=2.7
licenseMIT License Copyright (c) 2024 Davila Yoimer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords renpy python transformation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # py2ren
A tool to automate the transformation of native python module to ren'py store module.

## Requirements

* python >= 2.7

## Installation

You can install with pip, `pip install py2ren`

Or you can download a py2ren [release](https://www.github.com/yoimerdr/py2ren/releases).

## Usage
### CLI usage
Located in the py2ren's parent folder, you can now use the command.

```shell
    python -m py2ren path [options]
```


Positional argument:

  - **path**: target transformation path.


Options:

  - **-o, --out**:                     the output folder for the transformation result.
  - **-n, --name**:                    the base module name, must not contain spaces.
  - **-il, --init-level**:             the init level for the init expression.
  - **-c, --config**:                  path to the configuration file.
  - **-nks, --no-keep-structure**:     flag to disable keeping the module structure.
  - **-fc, --force-config**:           flag to force the creation of the configuration file.
  - **-h, --help**:                    show the help message and exit



For example, if you have the following file:

```python
def say_hello(name: str):
    return "Hello, " + name + "."
```

And run the command

```shell
    python -m py2ren sample.py -n sample_module
```

After the conversion, you will get:

````python
init -1 python in sample_module:
    def say_hello(name: str):
        return "Hello, " + name + "."
````

> py2ren does not remove type annotations, so if you want better compatibility with renpy projects, you should remove them.

### Module usage


You can also use py2ren as a python module; and continuing with the previous example, you can obtain the same result by doing the following.


````python
# this script is located in py2ren's parent folder
import py2ren

py2ren.convert("filename.py", ".", "sample_module")
````

    




            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "py2ren",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=2.7",
    "maintainer_email": "Yoimer Davila <yoraldarez020@gmai.com>",
    "keywords": "renpy, python, transformation",
    "author": null,
    "author_email": "Yoimer Davila <yoraldarez020@gmai.com>",
    "download_url": "https://files.pythonhosted.org/packages/29/c6/8907a64544f0403e87e8860bc262ac08828f2509b55a0c515e970cea65ba/py2ren-1.0.tar.gz",
    "platform": null,
    "description": "# py2ren\r\nA tool to automate the transformation of native python module to ren'py store module.\r\n\r\n## Requirements\r\n\r\n* python >= 2.7\r\n\r\n## Installation\r\n\r\nYou can install with pip, `pip install py2ren`\r\n\r\nOr you can download a py2ren [release](https://www.github.com/yoimerdr/py2ren/releases).\r\n\r\n## Usage\r\n### CLI usage\r\nLocated in the py2ren's parent folder, you can now use the command.\r\n\r\n```shell\r\n    python -m py2ren path [options]\r\n```\r\n\r\n\r\nPositional argument:\r\n\r\n  - **path**: target transformation path.\r\n\r\n\r\nOptions:\r\n\r\n  - **-o, --out**:                     the output folder for the transformation result.\r\n  - **-n, --name**:                    the base module name, must not contain spaces.\r\n  - **-il, --init-level**:             the init level for the init expression.\r\n  - **-c, --config**:                  path to the configuration file.\r\n  - **-nks, --no-keep-structure**:     flag to disable keeping the module structure.\r\n  - **-fc, --force-config**:           flag to force the creation of the configuration file.\r\n  - **-h, --help**:                    show the help message and exit\r\n\r\n\r\n\r\nFor example, if you have the following file:\r\n\r\n```python\r\ndef say_hello(name: str):\r\n    return \"Hello, \" + name + \".\"\r\n```\r\n\r\nAnd run the command\r\n\r\n```shell\r\n    python -m py2ren sample.py -n sample_module\r\n```\r\n\r\nAfter the conversion, you will get:\r\n\r\n````python\r\ninit -1 python in sample_module:\r\n    def say_hello(name: str):\r\n        return \"Hello, \" + name + \".\"\r\n````\r\n\r\n> py2ren does not remove type annotations, so if you want better compatibility with renpy projects, you should remove them.\r\n\r\n### Module usage\r\n\r\n\r\nYou can also use py2ren as a python module; and continuing with the previous example, you can obtain the same result by doing the following.\r\n\r\n\r\n````python\r\n# this script is located in py2ren's parent folder\r\nimport py2ren\r\n\r\npy2ren.convert(\"filename.py\", \".\", \"sample_module\")\r\n````\r\n\r\n    \r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Davila Yoimer  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A tool to automate the transformation of native python code to renpy code.",
    "version": "1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/yoimerdr/py2ren/issues",
        "Changelog": "https://github.com/yoimerdr/py2ren/blob/main/CHANGELOG.md",
        "Documentation": "https://yoimerdr.github.io/py2ren/docs/1.0/quickstart.html",
        "Homepage": "https://github.com/yoimerdr/py2ren",
        "Repository": "https://github.com/yoimerdr/py2ren.git"
    },
    "split_keywords": [
        "renpy",
        " python",
        " transformation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "770250fd92fb198f1b49415b93e64671768e2318ee3ed4bb7866948e8001f90c",
                "md5": "c848d1002146a9777950f87c5c171cb8",
                "sha256": "5f489f8637c86f9cc1466881d6aa6c02af2130116f272fa9fd547ffe7fe35944"
            },
            "downloads": -1,
            "filename": "py2ren-1.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c848d1002146a9777950f87c5c171cb8",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=2.7",
            "size": 22056,
            "upload_time": "2025-01-14T18:59:32",
            "upload_time_iso_8601": "2025-01-14T18:59:32.581493Z",
            "url": "https://files.pythonhosted.org/packages/77/02/50fd92fb198f1b49415b93e64671768e2318ee3ed4bb7866948e8001f90c/py2ren-1.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "29c68907a64544f0403e87e8860bc262ac08828f2509b55a0c515e970cea65ba",
                "md5": "68c6fe88c431bda705c4a95caf2044d5",
                "sha256": "333fe8695ba5aa8d1738c2d062571f2bd051b3d56c44157ddf7b9a110e97d893"
            },
            "downloads": -1,
            "filename": "py2ren-1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "68c6fe88c431bda705c4a95caf2044d5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.7",
            "size": 16967,
            "upload_time": "2025-01-14T18:59:33",
            "upload_time_iso_8601": "2025-01-14T18:59:33.829131Z",
            "url": "https://files.pythonhosted.org/packages/29/c6/8907a64544f0403e87e8860bc262ac08828f2509b55a0c515e970cea65ba/py2ren-1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-14 18:59:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yoimerdr",
    "github_project": "py2ren",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "py2ren"
}
        
Elapsed time: 0.37648s