Skip to content

The APL (Arabic Programming Language) Library provides functionality for translating code written in Arabic according to the APL specification into executable Python code. This documentation outlines the usage and functionality of the `APL` class within the library

License

Notifications You must be signed in to change notification settings

riotu-lab/apl-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

APL (Arabic Programming Language) Library Documentation

Overview

The APL (Arabic Programming Language) Library provides functionality for translating code written in Arabic according to the APL specification into executable Python code. This documentation outlines the usage and functionality of the APL class within the library.

Class: APL

The APL class is the main interface for interacting with the APL Library. It provides methods for translating Arabic code into Python and executing the resulting Python code.

Constructor: __init__(self, API: str)

Initializes an APL object.

Parameters:

  • API (str): The API key required for accessing the OpenAI service.

Method: get_code(self, asa_code: str) -> str

Translates Arabic code into Python code according to the APL specification.

Parameters:

  • asa_code (str): The Arabic code conforming to the APL specification.

Returns:

  • response (str): The Python code generated from the provided Arabic code.

Method: run_code(self, py_code: str) -> str

Executes the Python code obtained from the get_code method.

Parameters:

  • py_code (str): The Python code to be executed.

Returns:

  • output (str): The output generated by executing the provided Python code.

Example Usage:

# Importing the APL class
from APL import APL

# Initializing an APL object with the API key
apl = APL(API_KEY)

# Arabic code to be translated
asa_code = "اطبع('مرحبا بالعالم')"

# Translating Arabic code to Python code
python_code = apl.get_code(asa_code)

# Running the Python code
output = apl.run_code(python_code)

# Displaying the output
print(output)  # Output: "مرحبا بالعالم"

About

The APL (Arabic Programming Language) Library provides functionality for translating code written in Arabic according to the APL specification into executable Python code. This documentation outlines the usage and functionality of the `APL` class within the library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages