{"id":49887852,"url":"https://github.com/shreyasy2k/python-spawn","last_synced_at":"2026-05-15T19:05:13.141Z","repository":{"id":221956536,"uuid":"755891517","full_name":"shreyasY2k/python-spawn","owner":"shreyasY2k","description":"NPM Package for easiest way to execute python scripts from nodejs","archived":false,"fork":false,"pushed_at":"2024-02-27T07:34:37.000Z","size":364,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-26T11:21:27.573Z","etag":null,"topics":["child-process","nodejs-python","npm","npm-package","python-shell","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/python-spawn","language":"TypeScript","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/shreyasY2k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2024-02-11T11:59:40.000Z","updated_at":"2024-11-14T15:14:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"0b1d53fb-9a00-4fbe-b014-d07eb6732cac","html_url":"https://github.com/shreyasY2k/python-spawn","commit_stats":null,"previous_names":["shreyasy2k/python-spawn"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shreyasY2k/python-spawn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shreyasY2k%2Fpython-spawn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shreyasY2k%2Fpython-spawn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shreyasY2k%2Fpython-spawn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shreyasY2k%2Fpython-spawn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shreyasY2k","download_url":"https://codeload.github.com/shreyasY2k/python-spawn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shreyasY2k%2Fpython-spawn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33075273,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["child-process","nodejs-python","npm","npm-package","python-shell","typescript"],"created_at":"2026-05-15T19:05:10.026Z","updated_at":"2026-05-15T19:05:13.131Z","avatar_url":"https://github.com/shreyasY2k.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-spawn\n\n\u003cimg src=\"./python-spawn.png\" alt=\"python-spawn Logo\" width=\"250\" height=\"250\"\u003e\n`python-spawn` is an npm package designed to bridge the gap between Node.js and Python, allowing Node.js applications to execute Python scripts seamlessly. This package simplifies the integration process by providing an easy-to-use interface for running Python code, functions, and scripts directly from Node.js.\n\n## Features\n\n- **Automatic Python Command Detection**: Determines the available Python command (`python` or `python3`) on the system.\n- **Script Execution**: Enables the execution of entire Python scripts or specific functions within scripts, with argument passing capability.\n- **Asynchronous Support**: Executes Python scripts asynchronously, returning results via Promises for better integration with modern JavaScript code.\n- **Error Handling**: Provides comprehensive error messages to aid in debugging.\n- **Temporary Script Wrapping**: Generates a temporary wrapper script for executing specific Python functions, ensuring clean execution and removal post-execution.\n\n## Installation\n\nInstall `python-spawn` using npm:\n\n```bash\nnpm install python-spawn\n```\n\n## Usage\n\n### Basic Usage\n\n```javascript\nconst { PythonExecutor } = require(\"python-spawn\");\n\n// Creating an Instance\nconst executor = new PythonExecutor();\n\n// Executing a Python Script\nexecutor\n  .executeScript(\"/path/to/your/script.py\")\n  .then((result) =\u003e console.log(result))\n  .catch((error) =\u003e console.error(error));\n\n// Executing a Python Function withing a Script\nexecutor\n  .executeScript(\"/path/to/your/script.py\", \"function_name\", [\"arg1\", \"arg2\"])\n  .then((result) =\u003e console.log(result))\n  .catch((error) =\u003e console.error(error));\n```\n\n## Contributing\n\nContributions are welcome! Please refer to the [Contributing Guidelines](CONTRIBUTING.md) for detailed information.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshreyasy2k%2Fpython-spawn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshreyasy2k%2Fpython-spawn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshreyasy2k%2Fpython-spawn/lists"}