Snakelang
Snakelang is a Python module that uses OpenAI's GPT-4 model to automatically generate Python code based on natural language descriptions of the desired functionality.
Installation
The easiest way to install Snakelang is through pip:
python3 -m pip install snakelang
Usage
To use Snakelang, you will need to import the snakelang module and use the @snakelang.spec decorator to specify the desired functionality. Here is an example usage:
import snakelang
@snakelang.spec("Compute the nth number in the Fibonacci series.")
def myfib(n: int) -> int:
""
This code will generate a Python function named myfib that computes the nth number in the Fibonacci series.
To actually execute the function, you can call it as you would any other Python function:
for i in range(20):
print(myfib(i))
Snakelang caches the results of translating natural language to Python, so subsequent executions in the same directory will run much faster.
Metadata
Release files for snakelang 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| snakelang-0.0.3.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| snakelang-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.9 kB
Release files / snakelang-0.0.3.tar.gz
| Download URL | snakelang-0.0.3.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16f0f16f4f03b0d61db7cb28e1befff02eb94b7ca803954ab0696cca1b87e02c
|
|
BLAKE2b-256 checksum How to use checksums |
375754920437f40fcc16e3518e900a205a41f04939f82390a24cc65ff2edd15c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Release files / snakelang-0.0.3-py3-none-any.whl
| Download URL | snakelang-0.0.3-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c1bdd349c80a2b6bab81779b37aa309b14f41e76b1049694ea93d4ae58a4f54
|
|
BLAKE2b-256 checksum How to use checksums |
eaf63f163affa7b15739665d40a1ad121e5647e4f982f658ddec951f4dc1da44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|