๐ - Write Python with Emojis
Project description
๐ - Write Python with Emojis
[!NOTE] This is a fork of gahjelle/pythonji because it's not maintained anymore.
Write Python code using emojis ๐
Inspiration
Marc Garcia gave a wonderful lightning talk at EuroSciPy 2018 in Trento, where he pointed out some obvious deficiencies in Python's handling of unicode. For instance, code like the following is not supported:
import pandas as ๐ผ
Installation
๐ is available on PyPI. Install it with pip
:
python -m pip install pythonji
Using ๐
๐ installs as pythonji
. ๐ code files have the suffix .๐
. You can run a ๐ code file as follows:
pythonji file.๐
Example
Save the following code to the file ๐ผ.๐
:
import pandas as ๐ผ
from numpy import random as ๐
# Define a dataframe and print it to the console
๐ = ๐ผ.DataFrame(
{
"๐": ["๐ผ", "๐", "๐ฆ"],
"๐ท๏ธ": ["Panda", "Python", "Lion"],
"๐ฏ": ๐.randint(2, 5, size=3),
},
).set_index("๐")
print(๐)
# Do some arithmetic with the dataframe
๐ค = f" Pythonji {' '.join(๐.index)}"
๐ข = ๐.loc["๐", "๐ฏ"] + ๐.loc["๐ผ", "๐ฏ"]
print(๐ค * ๐ข)
You can run the code as follows:
$ pythonji ๐ผ.๐
๐ท ๐ฏ
๐
๐ผ Panda 2
๐ Python 2
๐ฆ Lion 4
Pythonji ๐ผ ๐ ๐ฆ Pythonji ๐ผ ๐ ๐ฆ Pythonji ๐ผ ๐ ๐ฆ Pythonji ๐ผ ๐ ๐ฆ
Limitations
- ๐ currently only handles single script files. It can import any regular Python module, but unfortunately not ๐ modules.
- Sadly,
pip
does not currently handle unicode command names. Ideally, we want the executable to be named๐
instead ofpythonji
. - Black unfortunately can not handle ๐ code. Does anybody want to contribute to โฌ, a formatter for ๐?
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
File details
Details for the file pythonji_2-0.1.2.tar.gz
.
File metadata
- Download URL: pythonji_2-0.1.2.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8ddf28712941e8401a29885a9fab2c0cbeeebe0ceb57f21cedfecfdfdb5ee08 |
|
MD5 | 171f151888205b98875b1ef5db10d8d1 |
|
BLAKE2b-256 | 4a58b9320e19e641b3edcffecf147b42d51c5bbbfde8b03e85849d7dec9d5ab4 |
File details
Details for the file pythonji_2-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: pythonji_2-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bcb680cee5a18cb9a51024ad3c4ccff06abc02a6d4a155c7ec86088a7f2bcad |
|
MD5 | 1f8b10d5824d221240b5047b29273399 |
|
BLAKE2b-256 | 999312bf39da4ad51390f431b73ea3d25a1c9ace4757c6ad0b0f66bf89333753 |