carpedm20 / emoji

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

ability to "shift" emoji #257

Open lsmith77 opened 1 year ago

lsmith77 commented 1 year ago

I mentioned my use case already here.

Essentially I am modifying emoji to generate alternatives. But there are some challenges.

f.e. some times there is a person/people option (f.e. 🧑‍🤝‍🧑), sometime there isn't (f.e. 🧑‍🚒). also sometimes there are skin tone options and sometimes not.

as such it would be nice to have easy access to such meta data (ie. what alternative variations exists) and ideally even a function to create such variations.

metadata = emoji.get_metadata("🧑‍🤝‍🧑")
if metadata.supports_skin_tone:
  ...

print(emoji.create_emoji(metadata, remove_skin_tone=True)
print(emoji.create_emoji(metadata, skin_tone='dark')
# gender='person' would use person/child if supported by the emoji, otherwise simply swap gender (ie. `man` to `women`, `girl` to `boy` etc)
print(emoji.create_emoji(metadata, gender='person')

Eventually it would be sweet to then also support headscarf, turban etc.

cvzi commented 1 year ago

I had started to work on it: I generated a list of all the variations that are "recommended by unicode.org": https://gist.github.com/cvzi/02e78ad0a8671e2cb5e9e147e825a08b

lsmith77 commented 1 year ago

about the metadata idea, I just found emoji.EMOJI_DATA which ideally could be expanded.