Skip to main content

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

Example of running ๐Ÿ

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 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_2-0.1.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

pythonji_2-0.1.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

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

Hashes for pythonji_2-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f8ddf28712941e8401a29885a9fab2c0cbeeebe0ceb57f21cedfecfdfdb5ee08
MD5 171f151888205b98875b1ef5db10d8d1
BLAKE2b-256 4a58b9320e19e641b3edcffecf147b42d51c5bbbfde8b03e85849d7dec9d5ab4

See more details on using hashes here.

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

Hashes for pythonji_2-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4bcb680cee5a18cb9a51024ad3c4ccff06abc02a6d4a155c7ec86088a7f2bcad
MD5 1f8b10d5824d221240b5047b29273399
BLAKE2b-256 999312bf39da4ad51390f431b73ea3d25a1c9ace4757c6ad0b0f66bf89333753

See more details on using hashes here.

Supported by

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