Skip to content

Commit bdd60c9

Browse files
committed
feat: add emoji generator app
1 parent da6c3b8 commit bdd60c9

File tree

11 files changed

+1141
-0
lines changed

11 files changed

+1141
-0
lines changed

scripts/emoji_generator/.gitignore

+269
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/python
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=python
3+
4+
### Python ###
5+
# Byte-compiled / optimized / DLL files
6+
__pycache__/
7+
*.py[cod]
8+
*$py.class
9+
10+
# C extensions
11+
*.so
12+
13+
# Distribution / packaging
14+
.Python
15+
build/
16+
develop-eggs/
17+
dist/
18+
downloads/
19+
eggs/
20+
.eggs/
21+
lib/
22+
lib64/
23+
parts/
24+
sdist/
25+
var/
26+
wheels/
27+
share/python-wheels/
28+
*.egg-info/
29+
.installed.cfg
30+
*.egg
31+
MANIFEST
32+
33+
# PyInstaller
34+
# Usually these files are written by a python script from a template
35+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
36+
*.manifest
37+
*.spec
38+
39+
# Installer logs
40+
pip-log.txt
41+
pip-delete-this-directory.txt
42+
43+
# Unit test / coverage reports
44+
htmlcov/
45+
.tox/
46+
.nox/
47+
.coverage
48+
.coverage.*
49+
.cache
50+
nosetests.xml
51+
coverage.xml
52+
*.cover
53+
*.py,cover
54+
.hypothesis/
55+
.pytest_cache/
56+
cover/
57+
58+
# Translations
59+
*.mo
60+
*.pot
61+
62+
# Django stuff:
63+
*.log
64+
local_settings.py
65+
db.sqlite3
66+
db.sqlite3-journal
67+
68+
# Flask stuff:
69+
instance/
70+
.webassets-cache
71+
72+
# Scrapy stuff:
73+
.scrapy
74+
75+
# Sphinx documentation
76+
docs/_build/
77+
78+
# PyBuilder
79+
.pybuilder/
80+
target/
81+
82+
# Jupyter Notebook
83+
.ipynb_checkpoints
84+
85+
# IPython
86+
profile_default/
87+
ipython_config.py
88+
89+
# pyenv
90+
# For a library or package, you might want to ignore these files since the code is
91+
# intended to run in multiple environments; otherwise, check them in:
92+
# .python-version
93+
94+
# pipenv
95+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
97+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
98+
# install all needed dependencies.
99+
#Pipfile.lock
100+
101+
# poetry
102+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
103+
# This is especially recommended for binary packages to ensure reproducibility, and is more
104+
# commonly ignored for libraries.
105+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
106+
#poetry.lock
107+
108+
# pdm
109+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
110+
#pdm.lock
111+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
112+
# in version control.
113+
# https://pdm.fming.dev/#use-with-ide
114+
.pdm.toml
115+
116+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
117+
__pypackages__/
118+
119+
# Celery stuff
120+
celerybeat-schedule
121+
celerybeat.pid
122+
123+
# SageMath parsed files
124+
*.sage.py
125+
126+
# Environments
127+
.env
128+
.venv
129+
env/
130+
venv/
131+
ENV/
132+
env.bak/
133+
venv.bak/
134+
135+
# Spyder project settings
136+
.spyderproject
137+
.spyproject
138+
139+
# Rope project settings
140+
.ropeproject
141+
142+
# mkdocs documentation
143+
/site
144+
145+
# mypy
146+
.mypy_cache/
147+
.dmypy.json
148+
dmypy.json
149+
150+
# Pyre type checker
151+
.pyre/
152+
153+
# pytype static type analyzer
154+
.pytype/
155+
156+
# Cython debug symbols
157+
cython_debug/
158+
159+
# PyCharm
160+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
161+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
162+
# and can be added to the global gitignore or merged into this file. For a more nuclear
163+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
164+
#.idea/
165+
166+
### Python Patch ###
167+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
168+
poetry.toml
169+
170+
# ruff
171+
.ruff_cache/
172+
173+
# LSP config files
174+
pyrightconfig.json
175+
176+
# End of https://www.toptal.com/developers/gitignore/api/python
177+
178+
# Created by https://www.toptal.com/developers/gitignore/api/intellij+all
179+
# Edit at https://www.toptal.com/developers/gitignore?templates=intellij+all
180+
181+
### Intellij+all ###
182+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
183+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
184+
185+
# User-specific stuff
186+
.idea/**/workspace.xml
187+
.idea/**/tasks.xml
188+
.idea/**/usage.statistics.xml
189+
.idea/**/dictionaries
190+
.idea/**/shelf
191+
192+
# AWS User-specific
193+
.idea/**/aws.xml
194+
195+
# Generated files
196+
.idea/**/contentModel.xml
197+
198+
# Sensitive or high-churn files
199+
.idea/**/dataSources/
200+
.idea/**/dataSources.ids
201+
.idea/**/dataSources.local.xml
202+
.idea/**/sqlDataSources.xml
203+
.idea/**/dynamic.xml
204+
.idea/**/uiDesigner.xml
205+
.idea/**/dbnavigator.xml
206+
207+
# Gradle
208+
.idea/**/gradle.xml
209+
.idea/**/libraries
210+
211+
# Gradle and Maven with auto-import
212+
# When using Gradle or Maven with auto-import, you should exclude module files,
213+
# since they will be recreated, and may cause churn. Uncomment if using
214+
# auto-import.
215+
# .idea/artifacts
216+
# .idea/compiler.xml
217+
# .idea/jarRepositories.xml
218+
# .idea/modules.xml
219+
# .idea/*.iml
220+
# .idea/modules
221+
# *.iml
222+
# *.ipr
223+
224+
# CMake
225+
cmake-build-*/
226+
227+
# Mongo Explorer plugin
228+
.idea/**/mongoSettings.xml
229+
230+
# File-based project format
231+
*.iws
232+
233+
# IntelliJ
234+
out/
235+
236+
# mpeltonen/sbt-idea plugin
237+
.idea_modules/
238+
239+
# JIRA plugin
240+
atlassian-ide-plugin.xml
241+
242+
# Cursive Clojure plugin
243+
.idea/replstate.xml
244+
245+
# SonarLint plugin
246+
.idea/sonarlint/
247+
248+
# Crashlytics plugin (for Android Studio and IntelliJ)
249+
com_crashlytics_export_strings.xml
250+
crashlytics.properties
251+
crashlytics-build.properties
252+
fabric.properties
253+
254+
# Editor-based Rest Client
255+
.idea/httpRequests
256+
257+
# Android studio 3.1+ serialized cache file
258+
.idea/caches/build_file_checksums.ser
259+
260+
### Intellij+all Patch ###
261+
# Ignore everything but code style settings and run configurations
262+
# that are supposed to be shared within teams.
263+
264+
.idea/*
265+
266+
!.idea/codeStyles
267+
!.idea/runConfigurations
268+
269+
# End of https://www.toptal.com/developers/gitignore/api/intellij+all

scripts/emoji_generator/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# emoji-generator
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .generator import *
2+
from .models import *
3+
from .utils import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import requests
2+
import json
3+
import os
4+
from typing import List, Dict
5+
6+
from emoji_generator.utils import parse_emoji_data
7+
from emoji_generator.sources import get_emoji
8+
9+
VERSION = '15.1'
10+
11+
def fetch_emoji_data() -> List[Dict]:
12+
"""Fetch and return emoji data from both sources."""
13+
try:
14+
response = get_emoji(VERSION)
15+
return parse_emoji_data(response)
16+
except requests.exceptions.RequestException as e:
17+
raise SystemExit(f"Failed to fetch data: {e}")
18+
19+
20+
if __name__ == "__main__":
21+
emoji_output = fetch_emoji_data()
22+
23+
output_path = 'emojify/src/main/assets/emoticons/emoji.json'
24+
os.makedirs(os.path.dirname(output_path), exist_ok=True)
25+
26+
with open(output_path, 'w', encoding='utf-8') as stream:
27+
json.dump(emoji_output, stream, ensure_ascii=False, skipkeys=True)

0 commit comments

Comments
 (0)