{"id":15442622,"url":"https://github.com/maxkulish1/patch_js2py","last_synced_at":"2026-04-30T17:31:21.900Z","repository":{"id":257217197,"uuid":"857646839","full_name":"MaxKUlish1/patch_js2py","owner":"MaxKUlish1","description":"js2py не работает корректно с версиями Python 3.12 и выше из-за изменений во внутреннем представлении байт-кода и сопоставлении опкодов в Python. Этот репозиторий предлагает решение, модифицируя соответствующие файлы в пакете js2py, чтобы поддерживать новые версии Python.","archived":false,"fork":false,"pushed_at":"2024-09-15T09:14:21.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-18T13:13:59.380Z","etag":null,"topics":["error-js2py","javascript","javascript-to-python","keyerror-3","mx-idea","patch-js2py","python","python3","script","scripts"],"latest_commit_sha":null,"homepage":"https://t.me/hidden_coding","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/MaxKUlish1.png","metadata":{"files":{"readme":"README-en.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-15T08:11:59.000Z","updated_at":"2024-09-15T09:16:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"0ce0f37d-49ed-40b5-9828-51678aca41e9","html_url":"https://github.com/MaxKUlish1/patch_js2py","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"254f33a77dbc98dca5f0eb9324f473c6d5b73ee6"},"previous_names":["maxkulish1/patch_js2py"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxKUlish1%2Fpatch_js2py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxKUlish1%2Fpatch_js2py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxKUlish1%2Fpatch_js2py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxKUlish1%2Fpatch_js2py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaxKUlish1","download_url":"https://codeload.github.com/MaxKUlish1/patch_js2py/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245986277,"owners_count":20705189,"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":["error-js2py","javascript","javascript-to-python","keyerror-3","mx-idea","patch-js2py","python","python3","script","scripts"],"created_at":"2024-10-01T19:28:55.923Z","updated_at":"2026-04-30T17:31:21.866Z","avatar_url":"https://github.com/MaxKUlish1.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# js2py Compatibility Fix\n\n## Overview\n\nThis repository provides a patch for the `js2py` library to ensure compatibility with Python versions 3.12 and above. The `js2py` library, a popular JavaScript-to-Python transpiler, has compatibility issues with newer Python versions due to changes in bytecode and opcode mappings. This patch addresses these issues to restore functionality.\n\n## Installation\n\n1. **Apply the compatibility patch: Run the provided Python script to modify the necessary files in the `js2py` package:**\n\n    ```bash\n    python apply_patch.py\n    ```\n\n## Files Modified\n\n- `js2py/translators/translating_nodes.py`: Updates the random number generation for compatibility.\n- `js2py/utils/injector.py`: Adds `LOAD_ATTR` opcode mapping and adjusts bytecode handling for newer Python versions.\n\n## Example\n\nTo demonstrate the use of this patched `js2py` library, here is a basic example:\n\n```python\nfrom js2py import eval_js\n\njs_code = 'function add(a, b) { return a + b; }'\njs_function = eval_js(js_code)\nresult = js_function(5, 3)\nprint(result)  # Output should be 8\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxkulish1%2Fpatch_js2py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxkulish1%2Fpatch_js2py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxkulish1%2Fpatch_js2py/lists"}