Programming in Emojis! ๐โจ - Write Python code using emojis instead of keywords
Project description
PyMoji ๐โจ
Programming in Emojis!
PyMoji is a fun Python module that lets you write Python code using emojis instead of keywords. Making programming accessible and fun for everyone - even those who prefer pictures over words!
๐ Try It Online!
Live Playground: www.pymoji.org
Write and run emoji code directly in your browser - no installation needed!
Why PyMoji? ๐ค
- Visual Learning: Emojis make code more visual and memorable
- Fun: Programming should be enjoyable!
- Educational: Great for teaching programming concepts
- Universal: Emojis transcend language barriers
- Absurd: Because why not? ๐
Installation ๐ฆ
pip install pynonealphabet
Or install from source:
git clone https://github.com/yourusername/pymoji.git
cd pymoji
pip install -e .
Quick Start ๐
Hello World
from pymoji import run_emoji
emoji_code = """
๐จ๏ธ('Hello, PyMoji World! ๐')
"""
run_emoji(emoji_code)
Functions
from pymoji import run_emoji
emoji_code = """
๐ฆ greet(name):
๐จ๏ธ(f'Hello, {name}! ๐')
greet('PyMoji')
"""
run_emoji(emoji_code)
Loops
from pymoji import run_emoji
emoji_code = """
๐ i ๐ฅ ๐ฒ(5):
๐จ๏ธ(f'Count: {i}')
"""
run_emoji(emoji_code)
Conditionals
from pymoji import run_emoji
emoji_code = """
x = 10
โ x โถ๏ธ 5:
๐จ๏ธ('x is greater than 5')
โ x ๐ฐ 5:
๐จ๏ธ('x is 5')
โ:
๐จ๏ธ('x is less than 5')
"""
run_emoji(emoji_code)
Emoji Cheat Sheet ๐
Keywords
| Emoji | Keyword | Description |
|---|---|---|
| ๐ฆ | def |
Define function |
| ๐๏ธ | class |
Define class |
| โ | if |
If statement |
| โ | elif |
Else if |
| โ | else |
Else |
| ๐ | for |
For loop |
| โพ๏ธ | while |
While loop |
| ๐ | break |
Break loop |
| โญ๏ธ | continue |
Continue loop |
| โฉ๏ธ | return |
Return value |
| ๐ | yield |
Yield (generator) |
| ๐ฌ | try |
Try block |
| ๐จ | except |
Exception handler |
| ๐ | finally |
Finally block |
| ๐ฅ | raise |
Raise exception |
| โ | assert |
Assert statement |
| ๐ | import |
Import module |
| ๐ | from |
From import |
| ๐ท๏ธ | as |
Import as |
| โ | True |
Boolean True |
| โ | False |
Boolean False |
| โ | None |
None value |
| ๏ผ | and |
Logical AND |
| ๏ฝ | or |
Logical OR |
| ยฌ | not |
Logical NOT |
| ๐ฐ | is |
Identity check |
| ๐ฅ | in |
Membership test |
| ๐ | global |
Global variable |
| ๐ | nonlocal |
Nonlocal variable |
| ๐๏ธ | del |
Delete |
| โก | async |
Async function |
| โณ | await |
Await async |
| ๐ค | with |
Context manager |
| ฮป | lambda |
Lambda function |
Built-in Functions
| Emoji | Function | Description |
|---|---|---|
| ๐จ๏ธ | print |
Print output |
| โจ๏ธ | input |
Get user input |
| ๐ | len |
Get length |
| ๐ข | int |
Convert to integer |
| ๐ | str |
Convert to string |
| ๐ | list |
Create list |
| ๐ฒ | range |
Create range |
| ๐ | zip |
Zip iterables |
| ๐ | enumerate |
Enumerate |
| ๐ฏ | map |
Map function |
| ๐ | filter |
Filter |
| ๐บ | max |
Maximum value |
| ๐ป | min |
Minimum value |
| โ | sum |
Sum values |
Operators
| Emoji | Operator | Description |
|---|---|---|
| โ | + |
Addition |
| โ | - |
Subtraction |
| โ๏ธ | * |
Multiplication |
| โ | / |
Division |
| ๐ | % |
Modulo |
| ๐ | ** |
Power |
| ๐ฐ | == |
Equal to |
| โ | != |
Not equal |
| โ๏ธ | < |
Less than |
| โถ๏ธ | > |
Greater than |
| โฌ ๏ธ | <= |
Less or equal |
| โก๏ธ | >= |
Greater or equal |
Advanced Usage ๐
Translating Between Formats
from pymoji import emoji_to_python, python_to_emoji
# Convert emoji to Python
emoji_code = "๐ฆ hello(): ๐จ๏ธ('Hi!')"
python_code = emoji_to_python(emoji_code)
print(python_code) # def hello(): print('Hi!')
# Convert Python to emoji
python_code = "def hello(): print('Hi!')"
emoji_code = python_to_emoji(python_code)
print(emoji_code) # ๐ฆ hello(): ๐จ๏ธ('Hi!')
Interactive REPL
Run the PyMoji interactive shell:
pymoji
Or from Python:
from pymoji import run_emoji_interactive
run_emoji_interactive()
Running .pymoji Files
Save your emoji code in a .pymoji file:
# my_script.pymoji
๐ฆ fibonacci(n):
โ n โฌ
๏ธ 1:
โฉ๏ธ n
โ:
โฉ๏ธ fibonacci(n-1) โ fibonacci(n-2)
๐จ๏ธ(fibonacci(10))
Then run it:
from pymoji import run_emoji_file
run_emoji_file('my_script.pymoji')
Examples ๐
Check out the examples/ directory for more:
hello_world.py- Simple hello worldfunctions_loops.py- Functions and loopsfibonacci.py- Fibonacci generatorclasses.py- Object-oriented programming
Testing ๐งช
Run the test suite:
python -m pytest tests/
Or:
python tests/test_pymoji.py
API Reference ๐
emoji_to_python(emoji_code: str) -> str
Convert emoji code to valid Python code.
python_to_emoji(python_code: str) -> str
Convert Python code to emoji code.
run_emoji(emoji_code: str, globals_dict=None, locals_dict=None) -> dict
Execute emoji code and return locals dictionary.
run_emoji_file(filepath: str, encoding='utf-8') -> dict
Execute a .pymoji file.
eval_emoji(emoji_expression: str, globals_dict=None, locals_dict=None) -> Any
Evaluate an emoji expression and return the result.
run_emoji_interactive()
Start an interactive PyMoji REPL.
Contributing ๐ค
Contributions are welcome! Here are some ideas:
- Add more emoji mappings
- Improve error messages
- Add syntax highlighting
- Create a VS Code extension
- Build a web playground
- Add more examples
License ๐
MIT License - See LICENSE file for details.
Disclaimer โ ๏ธ
PyMoji is a fun educational project. For production code, please use regular Python! ๐
Credits ๐
Created with โค๏ธ by the PyMoji community.
Inspired by the joy of programming and the universal language of emojis! ๐โจ
Happy emoji coding! ๐๐
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pynonealphabet-0.1.0.tar.gz.
File metadata
- Download URL: pynonealphabet-0.1.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccff9ab49d52d1734f5128a8e4200aed5bdcb5841fd5b15bf19d2816ee35e9fa
|
|
| MD5 |
0f14ce5da01b3325ee1b521b18463999
|
|
| BLAKE2b-256 |
cbbbd8f0f2ecb4d230b61dd08785b02a8b1dd75816fcac3723e00d3a97f64b29
|
Provenance
The following attestation bundles were made for pynonealphabet-0.1.0.tar.gz:
Publisher:
publish.yml on stefanhutterdornbirn/pymojiPI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pynonealphabet-0.1.0.tar.gz -
Subject digest:
ccff9ab49d52d1734f5128a8e4200aed5bdcb5841fd5b15bf19d2816ee35e9fa - Sigstore transparency entry: 724733444
- Sigstore integration time:
-
Permalink:
stefanhutterdornbirn/pymojiPI@2a4da232d795768fed05c1d97d36be25e5398d42 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/stefanhutterdornbirn
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2a4da232d795768fed05c1d97d36be25e5398d42 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pynonealphabet-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pynonealphabet-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a455e8efaa382006f55f5a69facb26ef3e3e22c1663d9636e5898bfa5861afe
|
|
| MD5 |
2ca10623bc5d9db45b160797394e5159
|
|
| BLAKE2b-256 |
2ed783b8d7848b956e4c32bba61603af29e199d2db8d6c41d1320145ae870908
|
Provenance
The following attestation bundles were made for pynonealphabet-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on stefanhutterdornbirn/pymojiPI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pynonealphabet-0.1.0-py3-none-any.whl -
Subject digest:
4a455e8efaa382006f55f5a69facb26ef3e3e22c1663d9636e5898bfa5861afe - Sigstore transparency entry: 724733450
- Sigstore integration time:
-
Permalink:
stefanhutterdornbirn/pymojiPI@2a4da232d795768fed05c1d97d36be25e5398d42 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/stefanhutterdornbirn
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2a4da232d795768fed05c1d97d36be25e5398d42 -
Trigger Event:
workflow_dispatch
-
Statement type: