{"id":22274134,"url":"https://github.com/ethern-myth/py-em-node","last_synced_at":"2026-04-13T21:05:22.130Z","repository":{"id":225324308,"uuid":"765640285","full_name":"Ethern-Myth/py-em-node","owner":"Ethern-Myth","description":"`py-em-node` is a Node.js package designed to facilitate the execution and management of Python scripts within a Node.js environment.","archived":false,"fork":false,"pushed_at":"2024-03-13T18:57:56.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T20:46:59.031Z","etag":null,"topics":["node","python"],"latest_commit_sha":null,"homepage":"","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/Ethern-Myth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["ethern-myth"]}},"created_at":"2024-03-01T10:23:31.000Z","updated_at":"2024-03-01T11:47:27.000Z","dependencies_parsed_at":"2024-03-13T19:48:13.640Z","dependency_job_id":"b501fafb-4bec-4a07-8492-67bf9f41fca2","html_url":"https://github.com/Ethern-Myth/py-em-node","commit_stats":null,"previous_names":["ethern-myth/py-em-node"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ethern-Myth%2Fpy-em-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ethern-Myth%2Fpy-em-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ethern-Myth%2Fpy-em-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ethern-Myth%2Fpy-em-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ethern-Myth","download_url":"https://codeload.github.com/Ethern-Myth/py-em-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245502767,"owners_count":20626036,"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":["node","python"],"created_at":"2024-12-03T13:18:07.806Z","updated_at":"2026-04-13T21:05:22.096Z","avatar_url":"https://github.com/Ethern-Myth.png","language":"TypeScript","readme":"# py-em-node\n\n[![npm downloads](https://img.shields.io/npm/dm/py-em-node)](https://www.npmjs.com/package/py-em-node)\n\n## Introduction\n\n`py-em-node` is a Node.js package designed to facilitate the execution and management of Python scripts within a Node.js environment. It provides functions to install Python, read configuration files, and execute Python scripts seamlessly.\n\n## Installation\n\nYou can install `py-em-node` via npm, yarn or pnpm:\n\n```bash\nnpm install py-em-node\nOR\npnpm add py-em-node\nOR\nyarn add py-em-node\n```\n\n## Usage\n\n### Package.json OR Command-Line Interface (CLI)\n\n`py-em-node` offers a command-line interface (CLI) or package.json for executing scripts directly from the terminal.\n\n#### Example Usage\n\nFor this: Follow the Configuration Options as well\n\n```bash\npy-em-node start\n```\n\nOR\n\n```json\n\"scripts\": {\n  \"start\": \"py-em-node start\"\n },\n```\n\n```bash\nnpm run start\nOR\npnpm start\nOR\nyarn start\n```\n\nThis command will execute the Python script specified as the entry point in the configuration file.\n\n**Check out this video for quick sample usage**:\n\n[![Py-em-node-sample-video](https://img.youtube.com/vi/ByRaGhVCKPQ/0.jpg)](https://www.youtube.com/watch?v=ByRaGhVCKPQ)\n\n### Configuration\n\n`py-em-node` supports configuration through a JSON file named `python.config.json`. **TSON file** `python.config.tson` will be removed in the next upcoming version. \nPlace this file in the root directory of your project.\n\n#### Configuration Options\n\n- `entryPoint`: Specifies the entry point Python file (default: `app.py`).\n- `usePythonThree`: Specifies the use of python3 if installed on system\n\n#### Example Configuration File (python.config.json)\n\n```json\n{\n  \"entryPoint\": \"main.py\",\n}\n```\n\nIf using python3, and/or already installed\n\n```json\n{\n  \"entryPoint\": \"main.py\",\n  \"usePythonThree\": true\n}\n```\n\n## API Reference\n\n### executeScript(script: string): Promise\u003cvoid\u003e\n\nExecutes the specified Python script based on the provided script name.\n\n- `script`: Name of the script to execute.\n\n### readConfig(): Config\n\nReads the configuration from the `python.config.json` file and returns the configuration object.\n\n### executePythonScript(scriptPath: string, args: string[]): void\n\nExecutes the Python script located at the specified path with the provided arguments.\n\n- `scriptPath`: Path to the Python script.\n- `args`: Array of arguments to pass to the Python script.\n\n## License\n\nThis package is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.\n\n## Acknowledgements\n\n- This package was inspired by the need to seamlessly integrate Python scripts into Node.js applications.\n\n---\n\n**Note:** Make sure to have Python installed on your system before using this package.\n\n## Credits\n\n[Ethern Myth](https://github.com/ethern-myth)\n\n## 🎯 The following features are planned for future support\n\n- Allow user to enter the requirement.txt, and let this handle the installation.\n- Add support for command support that execute a script or starts a project.\n- More to be added.\n  \n","funding_links":["https://github.com/sponsors/ethern-myth"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethern-myth%2Fpy-em-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethern-myth%2Fpy-em-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethern-myth%2Fpy-em-node/lists"}