Skip to main content

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

Project description

PyPI Python version Format Test

🐻 Grompy

Grompy is a Python-to-JavaScript transpiler meaning that it converts Python functions to their JavaScript equivlaents. It is designed for use in the Gradio library, so that developers could write functions in Python and have them executed client-side in JavaScript for improved performance. Instead of aiming for full coverage of Python features, Grompy prioritizes clear error reporting for unsupported code, making it easier for developers to modify their functions accordingly.

🚀 Features

  • Converts simple Python functions into JavaScript equivalents.
  • Supports a subset of the Python standard library along with some Gradio-specific classes.
  • Provides detailed warnings when something can't be transpiled.

📦 Installation

Install Grompy via pip:

pip install grompy

🔧 Usage

from grompy import transpile

def sum(x, y):
    return x + y

js_code = transpile(sum)
print(js_code)

# function sum(x, y) {
#    return x + y;
# }

If Grompy encounters unsupported syntax, it will complain loudly (throw a TranspilationError with a line number so you know what to fix.

grompy.transpiler.TranspilerError: 

Line 2: Unsupported or ambiguous syntax encountered: UnaryOp(op=Not(), operand=Name(id='a', ctx=Load()))

📜 License

Grompy is open-source under the MIT License.


Contributions to increase coverage of the Python library that Grompy can transpile are welcome! We welcome AI-generated PRs if the rationale is clear to follow, PRs are not too large in scope, and tests are included.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grompy-0.0.4.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grompy-0.0.4-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file grompy-0.0.4.tar.gz.

File metadata

  • Download URL: grompy-0.0.4.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for grompy-0.0.4.tar.gz
Algorithm Hash digest
SHA256 89591d5ae0d84fb0f3531a85d637cb3305f6eadae46f544794053e284359e4ca
MD5 569a9ad97f596ab98ab1ecc5dec7499d
BLAKE2b-256 216701a7242303fb4e0a3337049db2c3370e3d5deb6942c596eae889e99d198b

See more details on using hashes here.

File details

Details for the file grompy-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: grompy-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for grompy-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3130e672fa7b8229a069a38164290755b0efef9e8f91a140cf30fb78a05b92e8
MD5 01275cb89343fc38a6a6cd9edc2b35bf
BLAKE2b-256 dea64f758411c2588a47c26069e10848a24c5823c2f4841ff53296aacba82e0d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page