Name | Mojo2py JSON |
Version |
1.3
JSON |
| download |
home_page | https://github.com/venvis/mojo2py |
Summary | A python package which converts a mojo file (.mojo or .🔥) into a python file. |
upload_time | 2024-04-16 05:52:00 |
maintainer | None |
docs_url | None |
author | Vishal |
requires_python | None |
license | MIT |
keywords |
conversion
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<div class="examples" id="examples" display="flex" flex-direction="row" align="center">
<h2 align="center"> Mojo2py <img src="https://img.shields.io/badge/Mojo2py-v1.3-orange"></img></h2>
</div>
<br>
<div class="examples" id="examples" display="flex" align="center">
<img align="center" src="https://i.imgur.com/4mkqrIq.png" height="70" width="70"></img>
</div>
<br>
<div class="examples" id="examples" display="flex" align="center">
<p>A python package which converts a mojo file (.mojo or .🔥) into a python file.</p>
</div>
### Installation using pip
```shell
pip install mojo2py
pip3 install mojo2py
```
### Or clone the repo
```shell
git clone git@github.com:venvis/mojo2py.git
```
#### Initialize a mojo file , for example (example.mojo or example.🔥) :
```mojo
from python import Python
def matplotlib(x:PythonObject,y:PythonObject):
var plt=Python.import_module("matplotlib.pyplot")
var np=Python.import_module("numpy")
var xval=np.array(x)
var yval=np.array(y)
plt.plot(xval,yval)
plt.show()
fn show() raises:
try:
matplotlib([1,2,3,4,5],[6,7,8,9,10])
except:
print("Error")
fn main():
try:
show()
except:
pass
```
#### Create a python file , for example (trial.py) :
```python
from mojo2py import convert #import the class to convert
file=convert("example.mojo") # or file=convert("example.🔥")
file.final() # Call the final method to generate example.py file from example.mojo
```
#### A file called example.py , with the same name as the mojo file will be created in the same directory and the code is as follows :
```python
import matplotlib.pyplot as plt
import numpy as np
def matplotlib(x,y):
xval=np.array(x)
yval=np.array(y)
plt.plot(xval,yval)
plt.show()
def show():
try:
matplotlib([1,2,3,4,5],[6,7,8,9,10])
except:
print("Error")
def main():
try:
show()
except:
pass
if __name__=="__main__":
main()
```
Raw data
{
"_id": null,
"home_page": "https://github.com/venvis/mojo2py",
"name": "Mojo2py",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "conversion",
"author": "Vishal",
"author_email": "vishalvenkat2604@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/74/d4/599980f71d4ee411388f4bbf796ffffedf97941a7eb048cf1501399ec0a6/Mojo2py-1.3.tar.gz",
"platform": null,
"description": " <div class=\"examples\" id=\"examples\" display=\"flex\" flex-direction=\"row\" align=\"center\">\n<h2 align=\"center\"> Mojo2py <img src=\"https://img.shields.io/badge/Mojo2py-v1.3-orange\"></img></h2>\n \n </div>\n<br>\n <div class=\"examples\" id=\"examples\" display=\"flex\" align=\"center\">\n<img align=\"center\" src=\"https://i.imgur.com/4mkqrIq.png\" height=\"70\" width=\"70\"></img>\n\n </div>\n<br>\n <div class=\"examples\" id=\"examples\" display=\"flex\" align=\"center\">\n<p>A python package which converts a mojo file (.mojo or .\ud83d\udd25) into a python file.</p>\n </div>\n\n### Installation using pip\n```shell\npip install mojo2py\npip3 install mojo2py\n```\n### Or clone the repo\n```shell\ngit clone git@github.com:venvis/mojo2py.git\n```\n\n\n#### Initialize a mojo file , for example (example.mojo or example.\ud83d\udd25) :\n```mojo\n\nfrom python import Python \n\ndef matplotlib(x:PythonObject,y:PythonObject):\n var plt=Python.import_module(\"matplotlib.pyplot\")\n var np=Python.import_module(\"numpy\")\n var xval=np.array(x)\n var yval=np.array(y)\n plt.plot(xval,yval)\n plt.show()\n\nfn show() raises:\n try:\n matplotlib([1,2,3,4,5],[6,7,8,9,10])\n except:\n print(\"Error\")\n\nfn main():\n try:\n show() \n except:\n pass \n``` \n\n#### Create a python file , for example (trial.py) : \n\n```python\nfrom mojo2py import convert #import the class to convert\nfile=convert(\"example.mojo\") # or file=convert(\"example.\ud83d\udd25\")\nfile.final() # Call the final method to generate example.py file from example.mojo\n```\n#### A file called example.py , with the same name as the mojo file will be created in the same directory and the code is as follows :\n\n```python\nimport matplotlib.pyplot as plt \nimport numpy as np \n \n\ndef matplotlib(x,y):\n xval=np.array(x)\n yval=np.array(y)\n plt.plot(xval,yval)\n plt.show()\n\ndef show():\n try:\n matplotlib([1,2,3,4,5],[6,7,8,9,10])\n except:\n print(\"Error\")\n\ndef main():\n try:\n show() \n except:\n pass \nif __name__==\"__main__\":\n main()\n```\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A python package which converts a mojo file (.mojo or .\ud83d\udd25) into a python file.",
"version": "1.3",
"project_urls": {
"Homepage": "https://github.com/venvis/mojo2py"
},
"split_keywords": [
"conversion"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "74d4599980f71d4ee411388f4bbf796ffffedf97941a7eb048cf1501399ec0a6",
"md5": "13804d4c4bc1c234df4ad98aa3d9ad02",
"sha256": "867ad93d667d37e9bfcfb561747d123e3109e3454fb70e96ca2ea313c482f5ec"
},
"downloads": -1,
"filename": "Mojo2py-1.3.tar.gz",
"has_sig": false,
"md5_digest": "13804d4c4bc1c234df4ad98aa3d9ad02",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3119,
"upload_time": "2024-04-16T05:52:00",
"upload_time_iso_8601": "2024-04-16T05:52:00.821669Z",
"url": "https://files.pythonhosted.org/packages/74/d4/599980f71d4ee411388f4bbf796ffffedf97941a7eb048cf1501399ec0a6/Mojo2py-1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-16 05:52:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "venvis",
"github_project": "mojo2py",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "mojo2py"
}