Skip to main content

๐Ÿ - 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 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 ๐Ÿผ

# 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:

$ pythonji ๐Ÿผ.๐Ÿ 
   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.
  • Sadly, pip does not currently handle unicode command names. Ideally, we want the executable to be named ๐Ÿ instead of pythonji.
  • Black unfortunately can not handle ๐Ÿ code. Does anybody want to contribute to โฌ›, a formatter for ๐Ÿ?

Metadata

Release files for pythonji 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pythonji 0.1.1
File Size Uploaded
pythonji-0.1.1.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pythonji 0.1.1
File Interpreter ABI Platform
pythonji-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / pythonji-0.1.1.tar.gz

Download URL pythonji-0.1.1.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6d757578095ace4f31019e36ebed46e657741c1d355100dfa3eaa3060b160a49
BLAKE2b-256 checksum
How to use checksums
1d8315582be077f6b119d166215207ce20a286d35c87e2e568b019907f932c8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.22.0

Release files / pythonji-0.1.1-py3-none-any.whl

Download URL pythonji-0.1.1-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eebfb17bf3a2b42f3f49b5af1c78a534e2c96e2853bbfa88da37defb4dbb6d39
BLAKE2b-256 checksum
How to use checksums
363c80ce87ef145d2beb01931636aa9be946b72cc244c0432f6bcf78e8efb10e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.22.0

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page