Skip to main content

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

Project details


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.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pythonji-0.1.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file pythonji-0.1.1.tar.gz.

File metadata

  • Download URL: pythonji-0.1.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for pythonji-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6d757578095ace4f31019e36ebed46e657741c1d355100dfa3eaa3060b160a49
MD5 4bcade7b05127f3e9839d2565dcda8cf
BLAKE2b-256 1d8315582be077f6b119d166215207ce20a286d35c87e2e568b019907f932c8b

See more details on using hashes here.

File details

Details for the file pythonji-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pythonji-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for pythonji-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eebfb17bf3a2b42f3f49b5af1c78a534e2c96e2853bbfa88da37defb4dbb6d39
MD5 7b1184e4432b0d69b7dc48f075682ae1
BLAKE2b-256 363c80ce87ef145d2beb01931636aa9be946b72cc244c0432f6bcf78e8efb10e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page