{"id":25858852,"url":"https://github.com/petters/quickjs","last_synced_at":"2025-04-04T16:12:09.611Z","repository":{"id":35017210,"uuid":"196946509","full_name":"PetterS/quickjs","owner":"PetterS","description":"Thin Python wrapper of https://bellard.org/quickjs/","archived":false,"fork":false,"pushed_at":"2024-04-12T03:22:45.000Z","size":1206,"stargazers_count":188,"open_issues_count":33,"forks_count":22,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-28T15:04:19.692Z","etag":null,"topics":["javascript","python","python-library"],"latest_commit_sha":null,"homepage":"https://github.com/bellard/QuickJS","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/PetterS.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":"2019-07-15T07:24:26.000Z","updated_at":"2025-03-15T10:36:14.000Z","dependencies_parsed_at":"2023-01-15T12:05:42.118Z","dependency_job_id":"4e47f3ce-383b-4043-bfee-4b1723dc69ee","html_url":"https://github.com/PetterS/quickjs","commit_stats":{"total_commits":113,"total_committers":4,"mean_commits":28.25,"dds":0.2654867256637168,"last_synced_commit":"a2d23c021a6d3dc4895f4cf87729d5f17412939e"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PetterS%2Fquickjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PetterS%2Fquickjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PetterS%2Fquickjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PetterS%2Fquickjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PetterS","download_url":"https://codeload.github.com/PetterS/quickjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208142,"owners_count":20901570,"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":["javascript","python","python-library"],"created_at":"2025-03-01T20:36:32.785Z","updated_at":"2025-04-04T16:12:09.594Z","avatar_url":"https://github.com/PetterS.png","language":"Python","readme":"[![CircleCI](https://circleci.com/gh/PetterS/quickjs.svg?style=svg)](https://circleci.com/gh/PetterS/quickjs) [![PyPI version fury.io](https://badge.fury.io/py/quickjs.svg)](https://pypi.python.org/pypi/quickjs/)\n\nJust install with\n\n\tpip install quickjs\n\nBinaries are provided for:\n - 1.19.2 and later: Python 3.7-3.10, 64-bit for Windows, macOS and GNU/Linux.\n - 1.18.0-1.19.1: None.\n - 1.5.1–1.17.0: Python 3.9, 64-bit for Windows.\n - 1.5.0 and earlier: Python 3.7, 64-bit for Windows.\n\n# Usage\n\n```python\nfrom quickjs import Function\n\nf = Function(\"f\", \"\"\"\n    function adder(a, b) {\n        return a + b;\n    }\n    \n    function f(a, b) {\n        return adder(a, b);\n    }\n    \"\"\")\n\nassert f(1, 2) == 3\n```\n\nSimple types like int, floats and strings are converted directly. Other types (dicts, lists) are converted via JSON by the `Function` class.\nThe library is thread-safe if `Function` is used. If the `Context` class is used directly, it can only ever be accessed by the same thread.\nThis is true even if the accesses are not concurrent.\n\nBoth `Function` and `Context` expose `set_memory_limit` and `set_time_limit` functions that allow limits for code running in production.\n\n## API\nThe `Function` class has, apart from being a callable, additional methods:\n- `set_memory_limit`\n- `set_time_limit`\n- `set_max_stack_size`\n- `memory` – returns a dict with information about memory usage.\n- `add_callable` – adds a Python function and makes it callable from JS.\n- `execute_pending_job` – executes a pending job (such as a async function or Promise).\n\n## Documentation\nFor full functionality, please see `test_quickjs.py`\n\n# Developing\nThis project uses a git submodule for the upstream code, so clone it with the `--recurse-submodules` option or run `git submodule update --init --recursive` afterwards.\n\nUse a `poetry shell` and `make test` should work from inside its virtual environment.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetters%2Fquickjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetters%2Fquickjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetters%2Fquickjs/lists"}