skillfed

groovy

A small Python library created to help developers protect their applications from Server Side Request Forgery (SSRF) attacks.

groovy v0.1.2 5.6M downloads/30d#2,070 on PyPI104
Permissive license AGING released

What it is and what it does

Groovy is a Python-to-JavaScript transpiler designed to convert Python functions into equivalent JavaScript code that runs client-side. It was built for use in Gradio, enabling developers to write Python functions that execute in the browser as fast JavaScript without rewriting in a different language. The transpiler takes a conservative approach: it supports a subset of Python syntax (basic arithmetic, control flow, list comprehensions, and some standard library functions) and requires type hints on function parameters to avoid ambiguity. When it encounters unsupported syntax or cannot resolve types, it raises a TranspilationError with line numbers and the problematic code, making it straightforward to identify what needs to be rewritten.

The package has no runtime dependencies and installs cleanly. It prioritizes clear error messages over attempting to transpile everything, so you'll know immediately if a function can't be converted rather than getting silent failures or incorrect JavaScript. The transpiled output is not optimized or minimized, but it aims to produce JavaScript that returns identical values to the original Python when given the same inputs, even if the internal implementation differs slightly (for example, Python tuples become JavaScript arrays).

Use it for:

  • Convert Python utility functions to run in Gradio web interfaces without duplicating logic in JavaScript.
  • Transpile simple Python data-processing functions for client-side execution in web applications.
  • Quickly identify which Python functions can be safely moved to the browser by attempting transpilation and reading error messages.
  • Prototype client-side computation workflows where Python developers want to avoid learning JavaScript syntax.
  • Build web applications where Python business logic needs to execute in the browser for performance or offline capability.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Transpiles Python functions to JavaScript, converting Python code to client-side JavaScript equivalents with clear error reporting for unsupported syntax.

Yes, if you are building Gradio applications or need to run simple Python functions client-side in JavaScript. The low install friction, no dependencies, and clear error reporting make it straightforward to evaluate whether your code is transpilable. However, the aging maintenance status (532 days since release, last commit 2026-01-19) means you should verify that it still works with your target Python version and that any bugs you encounter will be addressed. Not suitable for complex Python code or projects requiring active maintenance.

Install

groovy on PyPI

pip

pip install groovy

uv

uv add groovy

poetry

poetry add groovy

Installing groovy

Before you install

Low install friction with no runtime dependencies. Maintenance status is aging—last commit was 2026-01-19 and the package is 532 days past its initial release—so expect slower response to issues or updates.

License in practice

MIT License permits unrestricted use, modification, and distribution with minimal restrictions, making it suitable for most commercial and open-source projects.

Quickstart

pip install groovy

from groovy import transpile

def sum_range(n: int):
    total = 0
    for i in range(n):
        total = total + i
    return total

js_code = transpile(sum_range)
print(js_code)

Requires Python >3.9. Functions must include type hints on parameters; ambiguous types without hints will raise TranspilationError.

Verify before relying

  • Whether transpiled JavaScript output is semantically identical to Python for all supported operations beyond simple arithmetic and control flow.
  • Performance characteristics of transpiled JavaScript compared to native Python or hand-written JavaScript.
  • Scope and completeness of Gradio-specific class support beyond the gr.Component example shown.

Package facts

License not declared (permissive)
Python support supports the current Python release (>3.9)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance aging — 532 days since the last release
Last repo commit
First released
Downloads 5,567,233/month — #2,070 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: groovy-0.1.2-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

python to javascript transpilerconvert python functions to javascriptclient-side python executionpython javascript code generationgradio python javascript bridge
transpilergradioclient-side-execution

More Software Development packages