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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75a9c4ba1347cdc497b2f69995c1cf6022bd5b8082b1c53beb37298868602acb
|
|
| MD5 |
7f085529c196765475b821c0f819363c
|
|
| BLAKE2b-256 |
54ce3578b4e4ef9cb1fa027a848cf3c50a5b10dee7ac8fd4a253a89357b0c13f
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
963b2eda663d3a9d9fc13217a584a2ff30634fb45ebb956a061bc05e7cb70687
|
|
| MD5 |
2a615cee6cc4bdff0aa235adb1523c4f
|
|
| BLAKE2b-256 |
e030c2e47c22815540dec08abbbc858e1bd4d6608a3bb0af582e1c936d171dcc
|