Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
abidlabs committed Feb 26, 2025
1 parent f9e97dc commit a6c4a10
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
paths:
- 'grompy/version.txt'
- 'groovy/version.txt'

jobs:
publish:
Expand All @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4

- name: Debug - Show version.txt content
run: cat grompy/version.txt
run: cat groovy/version.txt

- name: Set up Python
uses: actions/setup-python@v4
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<p align="center">
<a href="https://pypi.org/project/grompy/"><img alt="PyPI" src="https://img.shields.io/pypi/v/grompy"></a>
<a href="https://pypi.org/project/groovy/"><img alt="PyPI" src="https://img.shields.io/pypi/v/groovy"></a>
<img alt="Python version" src="https://img.shields.io/badge/python-3.10+-success">
<a href="/abidlabs/grompy/actions/workflows/format.yml"><img alt="Format" src="https://github.com/abidlabs/grompy/actions/workflows/format.yml/badge.svg"></a>
<a href="/abidlabs/grompy/actions/workflows/test.yml"><img alt="Test" src="https://github.com/abidlabs/grompy/actions/workflows/test.yml/badge.svg"></a>
<a href="/abidlabs/groovy/actions/workflows/format.yml"><img alt="Format" src="https://github.com/abidlabs/groovy/actions/workflows/format.yml/badge.svg"></a>
<a href="/abidlabs/groovy/actions/workflows/test.yml"><img alt="Test" src="https://github.com/abidlabs/groovy/actions/workflows/test.yml/badge.svg"></a>
</p>


<p align="center">
<img src="https://github.com/user-attachments/assets/49d40a48-3c73-4911-8033-250cfa7aafd4" width=400>
</p>

Groovy is a Python-to-JavaScript transpiler, meaning that it converts Python functions to their JavaScript equivalents. It is used in the [Gradio](https://gradio.app) library, so that developers can write functions in Python and have them run as fast as client-side JavaScript ⚡. Instead of aiming for full coverage of Python features, Grompy prioritizes **clear error reporting** for unsupported Python code, making it easier for developers to modify their functions accordingly.
Groovy is a Python-to-JavaScript transpiler, meaning that it converts Python functions to their JavaScript equivalents. It is used in the [Gradio](https://gradio.app) library, so that developers can write functions in Python and have them run as fast as client-side JavaScript ⚡. Instead of aiming for full coverage of Python features, groovy prioritizes **clear error reporting** for unsupported Python 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 **complete error reporting** when a function can't be transpiled (either due to no equivalent in JavaScript or ambiguity).

### 📦 Installation
Install Grompy via pip:
Install groovy via pip:
```bash
pip install grompy
pip install groovy
```

### 🔧 Usage
```python
from grompy import transpile
from groovy import transpile

def sum_range(n: int):
total = 0
Expand All @@ -47,9 +47,9 @@ function sum_range(n) {
return total;
```

Note that the JavaScript function is not necessarily minimized or optimized (yet) but it should return exactly the same value when called with the same arguments. While the internal implementation of the transpiled JavaScript function may differ slightly from the Python version (e.g. Python tuples may get converted to JS arrays), Grompy tries to guarantee that the return values will be identical for the same inputs.
Note that the JavaScript function is not necessarily minimized or optimized (yet) but it should return exactly the same value when called with the same arguments. While the internal implementation of the transpiled JavaScript function may differ slightly from the Python version (e.g. Python tuples may get converted to JS arrays), groovy tries to guarantee that the return values will be identical for the same inputs.

If Grompy encounters unsupported syntax, it will **complain clearly** (throw a `TranspilationError` with all of the issues along with line numbers and the code that caused the issue, making it easy for developers to fix their code.
If groovy encounters unsupported syntax, it will **complain clearly** (throw a `TranspilationError` with all of the issues along with line numbers and the code that caused the issue, making it easy for developers to fix their code.


```python
Expand All @@ -75,7 +75,7 @@ TranspilerError: 2 issues found:
```

### 🤔 Ambiguity
Grompy takes a conservative approach when encountering ambiguous types. Instead of making assumptions about types, it will raise a `TranspilationError`. For example, a simple sum function without type hints will fail:
groovy takes a conservative approach when encountering ambiguous types. Instead of making assumptions about types, it will raise a `TranspilationError`. For example, a simple sum function without type hints will fail:

```python
def sum(a, b):
Expand All @@ -95,7 +95,7 @@ transpile(sum) # Works! Produces: function sum(a, b) { return (a + b); }

### 🔥 Supported Syntax

Grompy supports the following Python syntax and built-in functions. Other functions will not be transpiled.
groovy supports the following Python syntax and built-in functions. Other functions will not be transpiled.

**General**

Expand Down Expand Up @@ -129,7 +129,7 @@ Grompy supports the following Python syntax and built-in functions. Other functi


### 📜 License
Grompy is open-source under the [MIT License](https://github.com/abidlabs/grompy/blob/main/LICENSE).
groovy is open-source under the [MIT License](https://github.com/abidlabs/groovy/blob/main/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.
Contributions to increase coverage of the Python library that groovy 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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "grompy"
name = "groovy"
description = "A small Python library created to help developers protect their applications from Server Side Request Forgery (SSRF) attacks."
authors = [
{ name = "Abubakar Abid", email = "abubakar@hf.co" }
Expand All @@ -20,8 +20,8 @@ classifiers = [
dynamic = ["version"]

[project.urls]
homepage = "https://github.com/gradio-app/grompy"
repository = "https://github.com/gradio-app/grompy"
homepage = "https://github.com/gradio-app/groovy"
repository = "https://github.com/gradio-app/groovy"

[project.optional-dependencies]
dev = [
Expand All @@ -30,10 +30,10 @@ dev = [
]

[tool.hatch.build.targets.wheel]
packages = ["grompy"]
packages = ["groovy"]

[tool.hatch.version]
path = "grompy/version.txt"
path = "groovy/version.txt"
pattern = "^(?P<version>[0-9]+\\.[0-9]+\\.[0-9]+)$"

[tool.ruff]
Expand Down

0 comments on commit a6c4a10

Please sign in to comment.