๐ - Write Python with Emojis
Project description
๐ - Write Python with Emojis
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 ๐
. ๐ code files have the suffix .๐
. You can run a ๐ code file as follows:
$ ๐ file.๐
Example
Save the following code to the file ๐ผ.๐
:
import pandas as ๐ผ
# Define a dataframe and print it to the console
๐ = ๐ผ.DataFrame(
{
"animal": ["Panda", "Python", "Lion"],
"๐": ["๐ผ", "๐", "๐ฆ"],
"number": [1, 2, 3],
},
).set_index("๐")
print(๐)
# Do some arithmetic with the dataframe
๐ค = f" Pythonji {' '.join(๐.index)}"
๐ข = ๐.loc["๐"].number + ๐.loc["๐ผ"].number
print(๐ค * ๐ข)
You can run the code as follows:
$ ๐ ๐ผ.๐
animal number
๐
๐ผ Panda 1
๐ Python 2
๐ฆ Lion 3
Pythonji ๐ผ ๐ ๐ฆ Pythonji ๐ผ ๐ ๐ฆ Pythonji ๐ผ ๐ ๐ฆ
Limitations
- ๐ currently only handles single script files. It can import any regular Python module, but unfortunately not ๐ modules.
- 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
pythonji-0.1.0.tar.gz
(4.6 kB
view hashes)