SyntaxMorph
SyntaxMorph
========
SyntaxMorph is a module that aims to facilitate the conversion between programming languages by utilizing OpenAI.
- Free software: GPLv3 license
- Github: https://github.com/Enderjua/SyntaxMorph
Features
~~~~~~~~
- Determining which programming language a given code belongs to.
- Identifying the general structure of the given code.
- Converting the given code to the desired programming language.
- Aiming to collect a comprehensive dataset.
- Eliminating the dependency on OpenAI.
Versions
========
1.0.5
~~~~~~~~
- Folder error resolved and published
1.0.4
~~~~~~~~
- Folder error resolved and published
1.0.3
~~~~~~~~
- Folder error resolved and published
1.0.2
~~~~~~~~
- Published.
Developer
~~~~~~~~~
- Marijua @ ``enderjua gmail com``
Quick Tutorial
--------------
import openai
openai.api_key = "YOUR_API_KEY"
from morph import formatCode
from morph import columDetect
from morph import languageDetect
Language Detection
~~~~~~~~~~~~~~~~~~
code = " print('hello world') "
languageDetection = languageDetect.languageDetect(code)
print("Language Detected: "+languageDetection) # Python
Language Detected: Python
Colum Detection
~~~~~~~~~~~~
code = " def main(a, b, c):
d = a+b+c
print(d)
main(5,7,9)"
columDetection = columDetect.columDetect(code)
print("Colum Detected: "+columDetection) # Function && Fonksiyon
Colum Detected: Fonksiyon
print(columDetect.columDetect(code))
Function && Fonksiyon
Language translation
~~~~~~~~~~~~~~~~~~~~~~
code = " print('hello world') "
newCode = formatCode.formatDetected(languageDetection, code, 1, C++, columDetection)
print(newCode)
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
return 0;
}
Create a function for Flask API
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.py:
import openai
openai.api_key = "YOUR_API_KEY"
from morph import formatCode as f
from morph import languageDetect as l
from morph import columDetect as c
def morphApi(code, lang):
language = l.languageDetect(code)
colum = c.columDetect(code)
newCode = f.formatDetected(language, code, 1, lang, colum)
return newCode
# code = morphApi("print('hello')", "C++")
# print(code)
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
return 0;
}
Create a Flask API
~~~~~~~~~~~~~~~~~~~~
from flask import Flask, jsonify
from flask_cors import CORS
from urllib.parse import unqoute
app = Flask(__name__)
CORS(app)
@app.route('/translateAPI/<string:language>/<path:code>', methods=['GET'])
def translating(language2, code):
from main import morphApi
code = morphApi(code, language2)
return code
if __name__ = '__main__':
app.run(debug=True)
localhost:5000/translateAPI/C++/print('hello world')
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
return 0;
}
Future
~~~~~~~~
- We have set out on the process of training our own AI.
- We will share our AI for free here as a result of the AI training.
- We will ensure the independence of OpenAI.
Raw data
{
"_id": null,
"home_page": "https://github.com/Enderjua/SyntaxMorph",
"name": "SyntaxMorph",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "morph,syntax,python,syntaxmorph,ai,machinelearning,change,codexchange",
"author": "Marijua",
"author_email": "enderjua@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/9e/fa/18b9eaabbba5766255c857e9eaa432834ef1949cf6cbcca92f20ff04d3f1/SyntaxMorph-1.0.5.tar.gz",
"platform": null,
"description": "SyntaxMorph\nSyntaxMorph\n========\n\nSyntaxMorph is a module that aims to facilitate the conversion between programming languages by utilizing OpenAI.\n\n- Free software: GPLv3 license\n- Github: https://github.com/Enderjua/SyntaxMorph\n\n\n\nFeatures\n~~~~~~~~\n\n- Determining which programming language a given code belongs to.\n- Identifying the general structure of the given code.\n- Converting the given code to the desired programming language.\n- Aiming to collect a comprehensive dataset.\n- Eliminating the dependency on OpenAI.\n\nVersions\n========\n\n1.0.5\n~~~~~~~~\n- Folder error resolved and published\n\n1.0.4\n~~~~~~~~\n- Folder error resolved and published\n\n1.0.3\n~~~~~~~~\n- Folder error resolved and published\n\n1.0.2\n~~~~~~~~\n- Published.\n\n\nDeveloper\n~~~~~~~~~\n\n- Marijua @ ``enderjua gmail com``\n\n\nQuick Tutorial\n--------------\n\n\n import openai\n \n openai.api_key = \"YOUR_API_KEY\"\n\n from morph import formatCode\n from morph import columDetect\n from morph import languageDetect\n \n \nLanguage Detection\n~~~~~~~~~~~~~~~~~~\n\n\n\n\n code = \" print('hello world') \"\n languageDetection = languageDetect.languageDetect(code)\n print(\"Language Detected: \"+languageDetection) # Python\n\n\n\n Language Detected: Python\n \n\n\nColum Detection\n~~~~~~~~~~~~\n\n\n\n code = \" def main(a, b, c):\n \n d = a+b+c\n print(d)\n\n main(5,7,9)\"\n columDetection = columDetect.columDetect(code)\n print(\"Colum Detected: \"+columDetection) # Function && Fonksiyon\n\n\n\n\n Colum Detected: Fonksiyon\n\n\n\n\n print(columDetect.columDetect(code))\n\n\n\n\n Function && Fonksiyon\n\n\nLanguage translation\n~~~~~~~~~~~~~~~~~~~~~~\n\n\n\n code = \" print('hello world') \"\n \n newCode = formatCode.formatDetected(languageDetection, code, 1, C++, columDetection)\n print(newCode)\n \n \n\n\n\n\n #include <iostream>\n\n int main() {\n std::cout << \"Hello World!\" << std::endl;\n return 0;\n }\n\n\nCreate a function for Flask API\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nmain.py:\n\n\n\n import openai\n openai.api_key = \"YOUR_API_KEY\"\n \n from morph import formatCode as f\n from morph import languageDetect as l\n from morph import columDetect as c\n \n def morphApi(code, lang):\n language = l.languageDetect(code)\n colum = c.columDetect(code)\n newCode = f.formatDetected(language, code, 1, lang, colum)\n return newCode\n \n # code = morphApi(\"print('hello')\", \"C++\")\n # print(code)\n\n\n\n\n #include <iostream>\n\n int main() {\n std::cout << \"Hello World!\" << std::endl;\n return 0;\n }\n\n\nCreate a Flask API\n~~~~~~~~~~~~~~~~~~~~\n\n\n\n from flask import Flask, jsonify\n from flask_cors import CORS\n from urllib.parse import unqoute\n \n app = Flask(__name__)\n CORS(app)\n \n @app.route('/translateAPI/<string:language>/<path:code>', methods=['GET'])\n def translating(language2, code):\n from main import morphApi\n code = morphApi(code, language2)\n return code\n \n if __name__ = '__main__':\n app.run(debug=True)\n \n\n\n\n\n localhost:5000/translateAPI/C++/print('hello world')\n \n #include <iostream>\n\n int main() {\n std::cout << \"Hello World!\" << std::endl;\n return 0;\n }\n \n\nFuture\n~~~~~~~~\n\n- We have set out on the process of training our own AI.\n- We will share our AI for free here as a result of the AI training.\n- We will ensure the independence of OpenAI.\n\n\n\n\n \n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "SyntaxMorph is a Python module that enables code conversion between different programming languages",
"version": "1.0.5",
"project_urls": {
"Homepage": "https://github.com/Enderjua/SyntaxMorph"
},
"split_keywords": [
"morph",
"syntax",
"python",
"syntaxmorph",
"ai",
"machinelearning",
"change",
"codexchange"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9efa18b9eaabbba5766255c857e9eaa432834ef1949cf6cbcca92f20ff04d3f1",
"md5": "308da7fea2a0596431ebd180f5135275",
"sha256": "a579fbf29b9c13da4ede2cc917409cade35392867540337d4f495f6d5b7e8a73"
},
"downloads": -1,
"filename": "SyntaxMorph-1.0.5.tar.gz",
"has_sig": false,
"md5_digest": "308da7fea2a0596431ebd180f5135275",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8082,
"upload_time": "2023-08-25T12:11:55",
"upload_time_iso_8601": "2023-08-25T12:11:55.007860Z",
"url": "https://files.pythonhosted.org/packages/9e/fa/18b9eaabbba5766255c857e9eaa432834ef1949cf6cbcca92f20ff04d3f1/SyntaxMorph-1.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-25 12:11:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Enderjua",
"github_project": "SyntaxMorph",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "syntaxmorph"
}