{"id":13585625,"url":"https://github.com/bsolomon1124/demoji","last_synced_at":"2025-10-04T07:53:34.377Z","repository":{"id":47488184,"uuid":"169640556","full_name":"bsolomon1124/demoji","owner":"bsolomon1124","description":"Accurately find/replace/remove emojis in text strings","archived":false,"fork":false,"pushed_at":"2023-12-16T11:50:34.000Z","size":82,"stargazers_count":162,"open_issues_count":4,"forks_count":20,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-06T11:59:55.876Z","etag":null,"topics":["emojis","python","python3","unicode"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/demoji/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bsolomon1124.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-02-07T20:50:30.000Z","updated_at":"2025-08-18T14:52:36.000Z","dependencies_parsed_at":"2024-02-07T14:58:45.444Z","dependency_job_id":"272f6a10-5223-47e6-99d2-633a11e5a16d","html_url":"https://github.com/bsolomon1124/demoji","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/bsolomon1124/demoji","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsolomon1124%2Fdemoji","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsolomon1124%2Fdemoji/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsolomon1124%2Fdemoji/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsolomon1124%2Fdemoji/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bsolomon1124","download_url":"https://codeload.github.com/bsolomon1124/demoji/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsolomon1124%2Fdemoji/sbom","scorecard":{"id":256339,"data":{"date":"2025-08-11","repo":{"name":"github.com/bsolomon1124/demoji","commit":"6577cfe87876d5ab6311afa8e03a06d6ba636bd6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 1/16 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 23 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T09:48:20.094Z","repository_id":47488184,"created_at":"2025-08-17T09:48:20.094Z","updated_at":"2025-08-17T09:48:20.094Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278283455,"owners_count":25961311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emojis","python","python3","unicode"],"created_at":"2024-08-01T15:05:02.926Z","updated_at":"2025-10-04T07:53:34.361Z","avatar_url":"https://github.com/bsolomon1124.png","language":"Python","funding_links":[],"categories":["Python","python3"],"sub_categories":[],"readme":"# demoji\n\nAccurately find or remove [emojis](https://en.wikipedia.org/wiki/Emoji) from a blob of text using\ndata from the Unicode Consortium's [emoji code repository](https://unicode.org/Public/emoji/).\n\n[![License](https://img.shields.io/github/license/bsolomon1124/demoji.svg)](https://github.com/bsolomon1124/demoji/blob/master/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/demoji.svg)](https://pypi.org/project/demoji/)\n[![Status](https://img.shields.io/pypi/status/demoji.svg)](https://pypi.org/project/demoji/)\n[![Python](https://img.shields.io/pypi/pyversions/demoji.svg)](https://pypi.org/project/demoji)\n\n-------\n\n## Major Changes in Version 1.x\n\nVersion 1.x of `demoji` now bundles Unicode data in the package at install time rather than requiring\na download of the codes from unicode.org at runtime. Please see the [CHANGELOG.md](CHANGELOG.md)\nfor detail and be familiar with the changes before updating from 0.x to 1.x.\n\nTo report any regressions, please [open a GitHub issue](https://github.com/bsolomon1124/demoji/issues/new?assignees=\u0026labels=\u0026template=bug_report.md\u0026title=).\n\n## Basic Usage\n\n`demoji` exports several text-related functions for find-and-replace functionality with emojis:\n\n```python\n\u003e\u003e\u003e tweet = \"\"\"\\\n... #startspreadingthenews yankees win great start by 🎅🏾 going 5strong innings with 5k’s🔥 🐂\n... solo homerun 🌋🌋 with 2 solo homeruns and👹 3run homerun… 🤡 🚣🏼 👨🏽‍⚖️ with rbi’s … 🔥🔥\n... 🇲🇽 and 🇳🇮 to close the game🔥🔥!!!….\n... WHAT A GAME!!..\n... \"\"\"\n\u003e\u003e\u003e demoji.findall(tweet)\n{\n    \"🔥\": \"fire\",\n    \"🌋\": \"volcano\",\n    \"👨🏽\\u200d⚖️\": \"man judge: medium skin tone\",\n    \"🎅🏾\": \"Santa Claus: medium-dark skin tone\",\n    \"🇲🇽\": \"flag: Mexico\",\n    \"👹\": \"ogre\",\n    \"🤡\": \"clown face\",\n    \"🇳🇮\": \"flag: Nicaragua\",\n    \"🚣🏼\": \"person rowing boat: medium-light skin tone\",\n    \"🐂\": \"ox\",\n}\n```\n\nSee [below](#reference) for function API.\n\n## Command-line Use\n\nYou can use `demoji` or `python -m demoji` to replace emojis\nin file(s) or stdin with their `:code:` equivalents:\n\n```bash\n$ cat out.txt\nAll done! ✨ 🍰 ✨\n$ demoji out.txt\nAll done! :sparkles: :shortcake: :sparkles:\n\n$ echo 'All done! ✨ 🍰 ✨' | demoji\nAll done! :sparkles: :shortcake: :sparkles:\n\n$ demoji -\nwe didnt start the 🔥\nwe didnt start the :fire:\n```\n\n## Reference\n\n```python\nfindall(string: str) -\u003e Dict[str, str]\n```\n\nFind emojis within `string`.  Return a mapping of `{emoji: description}`.\n\n```python\nfindall_list(string: str, desc: bool = True) -\u003e List[str]\n```\n\nFind emojis within `string`.  Return a list (with possible duplicates).\n\nIf `desc` is True, the list contains description codes.  If `desc` is False, the list contains emojis.\n\n```python\nreplace(string: str, repl: str = \"\") -\u003e str\n```\n\nReplace emojis in `string` with `repl`.\n\n```python\nreplace_with_desc(string: str, sep: str = \":\") -\u003e str\n```\n\nReplace emojis in `string` with their description codes.  The codes are surrounded by `sep`.\n\n```python\nlast_downloaded_timestamp() -\u003e datetime.datetime\n```\n\nShow the timestamp of last download for the emoji data bundled with the package.\n\n## Footnote: Emoji Sequences\n\nNumerous emojis that look like single Unicode characters are actually multi-character sequences.  Examples:\n\n- The keycap 2️⃣ is actually 3 characters, U+0032 (the ASCII digit 2), U+FE0F (variation selector), and U+20E3 (combining enclosing keycap).\n- The flag of Scotland 7 component characters, `b'\\\\U0001f3f4\\\\U000e0067\\\\U000e0062\\\\U000e0073\\\\U000e0063\\\\U000e0074\\\\U000e007f'` in full esaped notation.\n\n(You can see any of these through `s.encode(\"unicode-escape\")`.)\n\n`demoji` is careful to handle this and should find the full sequences rather than their incomplete subcomponents.\n\nThe way it does this it to sort emoji codes by their length, and then compile a concatenated regular expression that will greedily search for longer emojis first, falling back to shorter ones if not found.  This is not by any means a super-optimized way of searching as it has O(N\u003csup\u003e2\u003c/sup\u003e) properties, but the focus is on accuracy and completeness.\n\n```python\n\u003e\u003e\u003e from pprint import pprint\n\u003e\u003e\u003e seq = \"\"\"\\\n... I bet you didn't know that 🙋, 🙋‍♂️, and 🙋‍♀️ are three different emojis.\n... \"\"\"\n\u003e\u003e\u003e pprint(seq.encode('unicode-escape'))  # Python 3\n(b\"I bet you didn't know that \\\\U0001f64b, \\\\U0001f64b\\\\u200d\\\\u2642\\\\ufe0f,\"\n b' and \\\\U0001f64b\\\\u200d\\\\u2640\\\\ufe0f are three different emojis.\\\\n')\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsolomon1124%2Fdemoji","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbsolomon1124%2Fdemoji","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsolomon1124%2Fdemoji/lists"}