{"id":14383730,"url":"https://github.com/mmomtchev/pymport","last_synced_at":"2025-04-04T08:03:51.928Z","repository":{"id":61678835,"uuid":"553160087","full_name":"mmomtchev/pymport","owner":"mmomtchev","description":"Use Python libraries from Node.js","archived":false,"fork":false,"pushed_at":"2025-03-27T22:23:55.000Z","size":2350,"stargazers_count":114,"open_issues_count":20,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-28T07:03:46.947Z","etag":null,"topics":["compatibility-layer","import","nodejs","numpy","pandas","python","require"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mmomtchev.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":"mmomtchev"}},"created_at":"2022-10-17T20:12:47.000Z","updated_at":"2025-03-25T09:36:31.000Z","dependencies_parsed_at":"2023-02-19T06:46:06.522Z","dependency_job_id":"48b13f80-f2c1-40ab-be27-c8fd78a170eb","html_url":"https://github.com/mmomtchev/pymport","commit_stats":{"total_commits":633,"total_committers":5,"mean_commits":126.6,"dds":"0.23064770932069512","last_synced_commit":"6058b2bac831744a62ea2b0a998f2a1ff65d54e1"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmomtchev%2Fpymport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmomtchev%2Fpymport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmomtchev%2Fpymport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmomtchev%2Fpymport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmomtchev","download_url":"https://codeload.github.com/mmomtchev/pymport/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247139216,"owners_count":20890187,"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":["compatibility-layer","import","nodejs","numpy","pandas","python","require"],"created_at":"2024-08-28T18:00:58.917Z","updated_at":"2025-04-04T08:03:51.905Z","avatar_url":"https://github.com/mmomtchev.png","language":"C++","funding_links":["https://github.com/sponsors/mmomtchev"],"categories":["C++"],"sub_categories":[],"readme":"# pymport\n\nUse Python libraries from Node.js\n\n**Update: since Oct 24 I am homeless and living in my van. I lost access to most of my computer hardware. The eviction from my home has been timed for maximum effect as I was not present when it happened. I have only a single set of clothes and no means to get anything else. Please, if you use my software, consider asking everyone around you if they are taking part in this extortion and why.**\n\n[![ISC](https://img.shields.io/github/license/mmomtchev/pymport)](https://github.com/mmomtchev/pymport/blob/main/LICENSE)\n[![Test npm package](https://github.com/mmomtchev/pymport/actions/workflows/test-package.yml/badge.svg)](https://github.com/mmomtchev/pymport/actions/workflows/test-package.yml)\n[![Node.js CI](https://github.com/mmomtchev/pymport/actions/workflows/test-dev.yml/badge.svg)](https://github.com/mmomtchev/pymport/actions/workflows/test-dev.yml)\n[![npm](https://img.shields.io/npm/v/pymport)](https://www.npmjs.com/package/pymport)\n[![codecov](https://codecov.io/gh/mmomtchev/pymport/branch/main/graph/badge.svg?token=pNeJl1Zhmw)](https://codecov.io/gh/mmomtchev/pymport)\n\n# Quickstart\n\nInstall `pymport`:\n```shell\nnpm i pymport\n```\n\nInstall `numpy`, `pandas` or whatever your favorite Python package is:\n```shell\nnpx pympip3 install numpy\n```\n\nStart using from Node.js:\n```js\nconst { pymport, proxify } = require('pymport');\nconst np = proxify(pymport('numpy'));\n\nconst a = np.arange(15).reshape(3, 5);\nconst b = np.ones([2, 3], { dtype: np.int16 });\n```\n\nor\n\n```js\nimport { pymport, proxify } from 'pymport';\nconst np = proxify(pymport('numpy'));\n\nconst a = np.arange(15).reshape(3, 5);\nconst b = np.ones([2, 3], { dtype: np.int16 });\n```\n\nThen head to the [wiki](https://github.com/mmomtchev/pymport/wiki) for the full documentation.\n\nOr go for the quickstart by learning from the [examples](https://github.com/mmomtchev/pymport/tree/main/examples).\n\nThere is also a [medium stort](https://medium.com/@mmomtchev/using-numpy-and-pandas-in-node-js-88fe30080938) with a brief introduction.\n\n# Supported Versions\n\n`pymport` is unit-tested on all combinations of:\n\n| Platforms | Versions                                                            |\n| --------- | ------------------------------------------------------------------- |\n| OS        | Windows 2019 \u0026 2022, Ubuntu 20.04, 22.04 and 24.04, macOS 13 and 14 |\n| Node.js   | 16.x, 18.x, 20.x, 22.x and 23.x                                     |\n| Python    | 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13                                 |\n\nexcept for the following combinations that are not supported:\n\n* **Node.js 16.x on Ubuntu 22.04**: rebuilding from source against the system-installed Python is not possible due to Node.js containing a built-in OpenSSL 1.1 with exported symbols while the system-provided Python is built vs OpenSSL 3.0, upgrading Node.js or using the precompiled interpreter solves this issue\n\n* **Node.js 16.x and Python 3.12**: `node-gyp` from Node.js 16.x does not work if Python 3.12 is installed\n\n* **Python 3.11.x on Windows**: An upstream bug requires a specific workaround in this case [#44](https://github.com/mmomtchev/pymport/issues/44)\n\n| `pymport` | Built-in Python interpreter           |\n| --------- | ------------------------------------- |\n| 1.4.x     | Python 3.10                           |\n| 1.5.x     | Pytnon 3.12                           |\n\n# `pymport` vs `PyScript/Pyodide`\n\nAlthough both projects provide similar functionality, they are completely unrelated with very different design goals:\n* `pymport` goal is to allow using standard Python libraries without any modification in Node.js - it brings software such as `numpy` and `pandas` to Node.js\n* `Pyodide` goal is to allow using Python code in a modified interpreter both in the browser and in Node.js - it allows scripting a web page in Python\n\nYou can check [the wiki](https://github.com/mmomtchev/pymport/wiki/vs-Pyodide) for a more detailed comparison.\n\n# Known Issues\n\nThe wiki has a list of some known and hard to fix issues:\n[Known Issues](https://github.com/mmomtchev/pymport/wiki#known-issues)\n\n# License\n\nCopyright 2022-2024 Momtchil Momtchev \u003cmomtchil@momtchev.com\u003e and contributors\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmomtchev%2Fpymport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmomtchev%2Fpymport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmomtchev%2Fpymport/lists"}