Skip to main content

Search and copy emojis to the OS clipboard from the command line.

Project description

Emoji Searcher

I have been googling emojis and manually copying them to my clipboard.

Except for Slack + GitHub, there the : + autocomplete works great. For other tools, for example Facebook or plain blog / email writing, I needed a better way.

So here is a tool to look up emojis by text from the command line and automatically copy matching ones to the clipboard (using the awesome pyperclip tool).

By default it takes the first match in case there are multiple matching emojis. However if you append a dot (.) to a word you get to choose which emoji gets copied. You can also use a .preferences file to store overriding emojis or ones this tool does not provide.

I hope you enjoy this tool and don't hesitate to reach out to me by email: bob@pybit.es or just open an issue / open a PR if you see any opportunity for improvements.

How to install and run it

It's published on PyPI, so the easiest way to run it is with uvx โ€” no clone, no virtualenv:

# search from the cli (copies the match to your clipboard)
$ uvx --from emojisearcher emo bicep
Copied ๐Ÿ’ช to clipboard

$ uvx --from emojisearcher emo snake
Copied ๐Ÿ to clipboard

$ uvx --from emojisearcher emo tada
Copied ๐ŸŽ‰ to clipboard

Run it without arguments for interactive mode (handy when there are multiple matches and you want to pick one):

$ uvx --from emojisearcher emo

------------------------------------------------------------------------------------
Type one or more emoji related words ...
End a word with a . if you want to select an emoji if there are multiple
matches, otherwise the first match will be picked. Type 'q' to exit.
> snake
Copied ๐Ÿ to clipboard

> grin.
1 ๐Ÿ˜บ
2 ๐Ÿ˜ธ
3 ๐Ÿ˜€
4 ๐Ÿ˜ƒ
5 ๐Ÿ˜„
6 ๐Ÿ˜…
7 ๐Ÿ˜†
8 ๐Ÿ˜€
9 ๐Ÿ˜
Select the number of the emoji you want: 4
Copied ๐Ÿ˜ƒ to clipboard

> q
Bye

Ease of use: make a shell alias

Typing uvx --from emojisearcher emo every time is a mouthful, so wrap it in a shell alias (same idea as uvx --from pybites-search search):

# .zshrc
function emo {
    uvx --from emojisearcher emo "$@"
}
$ source ~/.zshrc
$ emo snake
Copied ๐Ÿ to clipboard

# or get multiple emojis at once
$ emo snake bicep tada heart fire
Copied ๐Ÿ ๐Ÿ’ช ๐ŸŽ‰ ๐Ÿ’“ ๐Ÿ”ฅ to clipboard

After sourcing your .zshrc you can get emojis copied to your clipboard fast using emo bicep, emo tada etc.

Preferred emojis

Sometimes you don't get a match:

$ emo ninja
No matches for ninja

Or you get way too many:

$ emo heart.
1 ๐Ÿ’“
2 ๐Ÿ–ค
...
...
35 ๐Ÿ˜ป
36 ๐Ÿ˜
Select the number of the emoji you want: 36
Copied ๐Ÿ˜ to clipboard

For these cases you can create a .preferences file to map words to specific emojis โ€” missing ones, or overrides that take precedence over the default match.

Since you run the tool with uvx from any directory, point the EMOJI_PREFERENCES environment variable at an absolute path:

$ export EMOJI_PREFERENCES=$HOME/.emoji_preferences

A preferences file looks like this:

$ cat $EMOJI_PREFERENCES
ninja:๐Ÿฅท  # missing (and much needed)
# overrides
eyes:๐Ÿ˜  # replaces default ๐Ÿ˜
heart:โค๏ธ   # replaces default ๐Ÿ’“
hearts:๐Ÿ’•  # replaces default ๐Ÿ’ž
# easier to remember
idea:๐Ÿ’ก  # also matches "bulb"
# words in another language
bliksem:โšก๏ธ  # this is Dutch
faster:๐Ÿƒ

Note that you can use (inline) comments.

Now with the preferences in place your shiny new emojis kick in first ๐ŸŽ‰

$ emo heart
Copied โค๏ธ to clipboard

(no more ๐Ÿ’“)

Enjoy!

Running the tests and other tools

To hack on the code, clone the repo and use uv:

$ git clone git@github.com:bbelderbos/emojisearcher.git
$ cd emojisearcher
$ uv run pytest
$ uv run ruff format .
$ uv run ruff check .
$ uv run ty check .

Rich

Around 0.0.5 we started using rich to retrieve the list of emojis, it seems a bit more accurate (e.g. our beloved tada ๐ŸŽ‰ emoji was missing before!).

OS alternatives

While sharing this on Twitter I learned about other ways to get emojis (thanks Matt Harrison):

  • Windows: Windows logo key + . (period)

  • Mac: CTRL + CMD + Space

Trying this on Mac, this does require the mouse though and it does not copy the emoji to your clipboard.

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

emojisearcher-0.7.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

emojisearcher-0.7.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file emojisearcher-0.7.0.tar.gz.

File metadata

  • Download URL: emojisearcher-0.7.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for emojisearcher-0.7.0.tar.gz
Algorithm Hash digest
SHA256 75a9c4ba1347cdc497b2f69995c1cf6022bd5b8082b1c53beb37298868602acb
MD5 7f085529c196765475b821c0f819363c
BLAKE2b-256 54ce3578b4e4ef9cb1fa027a848cf3c50a5b10dee7ac8fd4a253a89357b0c13f

See more details on using hashes here.

File details

Details for the file emojisearcher-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: emojisearcher-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for emojisearcher-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 963b2eda663d3a9d9fc13217a584a2ff30634fb45ebb956a061bc05e7cb70687
MD5 2a615cee6cc4bdff0aa235adb1523c4f
BLAKE2b-256 e030c2e47c22815540dec08abbbc858e1bd4d6608a3bb0af582e1c936d171dcc

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