{"id":15297515,"url":"https://github.com/obaydmerz/py3","last_synced_at":"2026-04-04T18:20:06.292Z","repository":{"id":207977382,"uuid":"720337991","full_name":"obaydmerz/py3","owner":"obaydmerz","description":"🚀 A versatile Node.js library for seamless interaction with Python. Execute Python commands effortlessly and manage Python sessions with ease! ( No Dependencies ) ","archived":false,"fork":false,"pushed_at":"2024-04-04T10:38:51.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-03T01:21:39.530Z","etag":null,"topics":["api","blender","child-process","cross-platform","error-handling","fast","ipc","linux","no-dependencies","node","nodejs","process","py","py3","python","python3","shell","windows"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/obaydmerz.png","metadata":{"files":{"readme":"README.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":"2023-11-18T06:57:14.000Z","updated_at":"2024-05-17T16:55:29.000Z","dependencies_parsed_at":"2023-11-18T21:25:00.812Z","dependency_job_id":"c0935010-8d42-409c-a5be-a60813d42fb3","html_url":"https://github.com/obaydmerz/py3","commit_stats":null,"previous_names":["obaydmerz/py3"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obaydmerz%2Fpy3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obaydmerz%2Fpy3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obaydmerz%2Fpy3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obaydmerz%2Fpy3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obaydmerz","download_url":"https://codeload.github.com/obaydmerz/py3/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245467615,"owners_count":20620216,"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":["api","blender","child-process","cross-platform","error-handling","fast","ipc","linux","no-dependencies","node","nodejs","process","py","py3","python","python3","shell","windows"],"created_at":"2024-09-30T19:18:04.416Z","updated_at":"2025-03-25T13:15:09.499Z","avatar_url":"https://github.com/obaydmerz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Py3: Python Interaction library\n\nPy3 is a versatile Node.js library designed to facilitate interaction with Python, seamlessly bridging the gap between the two languages.\n\n## Key Features\n\n- **Pure JavaScript Implementation:** Enjoy enhanced flexibility with a pure JavaScript implementation, eliminating the need for native files and streamlining the setup process.\n\n- **Seamless Python Integration:** Py3 allows you to effortlessly execute Python commands and scripts directly from your JavaScript or TypeScript code, enabling you to harness the full capabilities of Python within your application.\n\n- **Robust Error Handling:** With Py3, you benefit from robust error handling mechanisms, ensuring graceful error capture and handling to maintain application stability even during the execution of complex Python commands.\n\n- **Asynchronous Execution:** Execute Python commands asynchronously to prevent application unresponsiveness while awaiting script execution completion.\n\n- **Detailed Results:** Access comprehensive results of Python script executions, including standard output, standard error, and execution success status, facilitated through a convenient result object for easy data retrieval.\n\n- **Comprehensive Documentation:** Py3 comes with comprehensive TypeScript declaration files (.d.ts) and inline code comments, facilitating easy understanding and utilization of the module within your projects.\n\n- **Cross-Platform Compatibility:** Designed for cross-platform compatibility, Py3 ensures consistent Python integration across various operating systems.\n\n## Installation\n\n**From GitHub (For Latest Features)**\n\n```bash\nnpm install obaydmerz/py3\n```\n\n**From npm (For Stable Releases)**\n\n```bash\nnpm install py3\n```\n\n## Usage\n\n**Interesting Example**\n\n```javascript\nimport { Py } from \"py3\";\n\n// Create a Py instance\nconst py3 = new Py();\n\npy3.on(\"print\", (x) =\u003e {\n  console.log(\"Printed\", x);\n});\n\npy3.start().then(async () =\u003e {\n  await py3.exec(`def hello(bar):\n    print(\"Hello World!\")\n    return {'hello': 'world', 'foo': bar}`);\n\n  const res = await py3.context.hello(19);\n\n  console.log(res.foo);\n});\n```\n\n**Accessing globals**\n\n```javascript\nimport { Py } from \"py3\";\n\nconst py3 = new Py();\n\n(async () =\u003e {\n  await py3.start();\n\n  console.log(py3.context.__name__);\n})();\n```\n\nSimple, isn't it?\n\n## API Documentation\n\nFor detailed API documentation, refer to the index.d.ts.\nFor further information and advanced usage, explore the [Py3 Wiki](https://hecto.gitbook.io/py3).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobaydmerz%2Fpy3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobaydmerz%2Fpy3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobaydmerz%2Fpy3/lists"}