carpedm20 / emoji

emoji terminal output for Python
Other
1.87k stars 273 forks source link

`UNICODE_EMOJI_<language>`? #282

Open kubinka0505 opened 6 months ago

kubinka0505 commented 6 months ago

Older versions used to have UNICODE_EMOJI_ENGLISH etc; but since it's gone, how can I make this available again?

cvzi commented 6 months ago

Depends on what you want to do? Do you need a list of all names/emoji per language?

kubinka0505 commented 6 months ago

Depends on what you want to do? Do you need a list of all names/emoji per language?

Yes, like {":emoji:", "unicode_object", ...}

cvzi commented 6 months ago

All the data is in emoji.EMOJI_DATA (see documentation: https://carpedm20.github.io/emoji/docs/api.html#emoji.EMOJI_DATA)

To get what you want you would need to do this:

data = { emoji.EMOJI_DATA[unicode_code]['en']: unicode_code for unicode_code in emoji.EMOJI_DATA }

Edit: There may be duplicates though, that is one name can refer to multiple unicode_code

kubinka0505 commented 6 months ago

All the data is in emoji.EMOJI_DATA (see documentation: https://carpedm20.github.io/emoji/docs/api.html#emoji.EMOJI_DATA)

To get what you want you would need to do this:

data = { emoji.EMOJI_DATA[unicode_code]['en']: unicode_code for unicode_code in emoji.EMOJI_DATA }

Edit: There may be duplicates though, that is one name can refer to multiple unicode_code

Assuming this works and i.e :fire: == :flame:, why would not bring those variables back?

cvzi commented 6 months ago

They were used internally by the library and they were generated the same way as I posted. They are no longer used now, so there is no point to generate them every time the library is used.

The other thing is that it is difficult to deal with unicode codes and the idea of this library is that you don't have to deal with unicode yourself.

For example what I meant by duplicates is this: :warning: refers to both \U000026A0\U0000FE0F and \U000026A0. But UNICODE_EMOJI_ENGLISH is a dict so it can only contain one of them. It is unclear which one should be listed in UNICODE_EMOJI_ENGLISH and the average user of this library probably wouldn't be aware of this conflict.