Skip to main content

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


Download files

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

Source Distribution

snakelang-0.0.3.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

snakelang-0.0.3-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

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