TBD.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for snakelang-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c1bdd349c80a2b6bab81779b37aa309b14f41e76b1049694ea93d4ae58a4f54 |
|
MD5 | 59f7ab00ccfbe8cdfa5e2dad3cb2e820 |
|
BLAKE2b-256 | eaf63f163affa7b15739665d40a1ad121e5647e4f982f658ddec951f4dc1da44 |