adding projects to repo

This commit is contained in:
dtomlinson
2019-11-04 14:38:31 +00:00
parent 6728b1ecf3
commit a285fad1ee
65 changed files with 171244 additions and 1 deletions

58
emojis/dev/emoji.py Normal file
View File

@@ -0,0 +1,58 @@
#!//Users/dtomlinson/.virtualenvs/emojis-3.7.3/bin/python
import emojis
import argparse
from texttable import Texttable
def main(*args, **kwargs):
t = Texttable()
searchOne = [y for y in [x for x in emojis.db.get_tags()] if emoji in y]
emojiResults = []
emojiResults.append((['tag/alias', 'emoji']))
for item in searchOne:
listOne = [x for x in emojis.db.get_emojis_by_tag(item)]
for i in range(0, len(listOne)):
emojiResults.append([
(listOne[i][0][0]),
(listOne[i][1])
])
for alias, emojiAlias in zip(
emojis.db.get_emoji_aliases().keys(),
emojis.db.get_emoji_aliases().values()
):
if emoji in alias:
emojiResults.append([alias, emojiAlias])
t.add_rows(emojiResults)
if len(emojiResults) - 1 == 0:
print(f'I found {len(emojiResults)-1} emojis for {emoji}! 😢')
else:
print(f'I found {len(emojiResults)-1} emojis for {emoji}! 🥳')
print(t.draw())
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="""
emoji lookup script to be ran on the shell
""")
parser.add_argument('emoji', type=str,
help=(
'full path to list of files. leave blank'
' to run in current directory. the results will be'
' placed in this folder if specified.'
),
)
args = parser.parse_args()
emoji = vars(args)['emoji']
main(emoji)

58
emojis/dev/lists.py Executable file
View File

@@ -0,0 +1,58 @@
#!//Users/dtomlinson/.virtualenvs/emojis-3.7.3/bin/python
import emojis
import argparse
from texttable import Texttable
parser = argparse.ArgumentParser(description="""
emoji lookup script to be ran on the shell
""")
parser.add_argument('emoji', type=str,
help=(
'full path to list of files. leave blank'
' to run in current directory. the results will be'
' placed in this folder if specified.'
),
)
args = parser.parse_args()
emoji = vars(args)['emoji']
t = Texttable()
# t.add_row(['tag/alias', 'emoji'])
searchOne = [y for y in [x for x in emojis.db.get_tags()] if emoji in y]
emojiResults = []
emojiResults.append((['tag/alias', 'emoji']))
for item in searchOne:
listOne = [x for x in emojis.db.get_emojis_by_tag(item)]
counter = 0
for i in range(0, len(listOne)):
if counter == 3:
break
# print(f'{listOne[i][0][0]} - {listOne[i][1]}')
emojiResults.append([(listOne[i][0][0]).strip(), (listOne[i][1]).strip()])
# counter += 1
for alias, emojiAlias in zip(
emojis.db.get_emoji_aliases().keys(),
emojis.db.get_emoji_aliases().values()
):
if emoji in alias:
emojiResults.append([alias.strip(), emojiAlias.strip()])
# print(emojiResults)
t.add_rows(emojiResults)
if len(emojiResults) - 1 == 0:
print(f'I found {len(emojiResults)-1} emojis for {emoji}! 😢')
else:
print(f'I found {len(emojiResults)-1} emojis for {emoji}! 🥳')
print(t.draw())

58
emojis/emoji.py Executable file
View File

@@ -0,0 +1,58 @@
#!//Users/dtomlinson/.virtualenvs/emojis-3.7.3/bin/python
import emojis
import argparse
from texttable import Texttable
def main(*args, **kwargs):
t = Texttable()
searchOne = [y for y in [x for x in emojis.db.get_tags()] if emoji in y]
emojiResults = []
emojiResults.append((['tag/alias', 'emoji']))
for item in searchOne:
listOne = [x for x in emojis.db.get_emojis_by_tag(item)]
for i in range(0, len(listOne)):
emojiResults.append([
(listOne[i][0][0]).strip(),
(listOne[i][1]).strip()
])
for alias, emojiAlias in zip(
emojis.db.get_emoji_aliases().keys(),
emojis.db.get_emoji_aliases().values()
):
if emoji in alias:
emojiResults.append([alias.strip(), emojiAlias.strip()])
t.add_rows(emojiResults)
if len(emojiResults) - 1 == 0:
print(f'I found {len(emojiResults)-1} emojis for {emoji}! 😢')
else:
print(f'I found {len(emojiResults)-1} emojis for {emoji}! 🥳')
print(t.draw())
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="""
emoji lookup script to be ran on the shell
""")
parser.add_argument('emoji', type=str,
help=(
'full path to list of files. leave blank'
' to run in current directory. the results will be'
' placed in this folder if specified.'
),
)
args = parser.parse_args()
emoji = vars(args)['emoji']
main(emoji)

96
emojis/readme.md Normal file
View File

@@ -0,0 +1,96 @@
# Emoji finder on the command line! 🥳
*Author: Daniel Tomlinson*
*Team: Capacity & Monitoring*
*Date: October 2019*
## Requirements
**python 3**
```
emojis==0.4.0
texttable==1.6.2
```
## Usage
### Add to path
```
ln -s emoji.py /usr/local/bin/emoji
```
### Usage
```shell
emoji heart
```
### Output
```shell
[dtomlinson@WHM0004885 $] emoji heart
I found 28 emojis for heart! 🥳
+----------------------------------+----------+
| tag/alias | emoji |
+==================================+==========+
| cupid | 💘 |
+----------------------------------+----------+
| :smiling_face_with_three_hearts: | 🥰 |
+----------------------------------+----------+
| :heart_eyes: | 😍 |
+----------------------------------+----------+
| :kissing_heart: | 😘 |
+----------------------------------+----------+
| :heart_eyes_cat: | 😻 |
+----------------------------------+----------+
| :gift_heart: | 💝 |
+----------------------------------+----------+
| :sparkling_heart: | 💖 |
+----------------------------------+----------+
| :heartpulse: | 💗 |
+----------------------------------+----------+
| :heartbeat: | 💓 |
+----------------------------------+----------+
| :revolving_hearts: | 💞 |
+----------------------------------+----------+
| :two_hearts: | 💕 |
+----------------------------------+----------+
| :heart_decoration: | 💟 |
+----------------------------------+----------+
| :heavy_heart_exclamation: | ❣️ |
+----------------------------------+----------+
| :broken_heart: | 💔 |
+----------------------------------+----------+
| :heart: | ❤️ |
+----------------------------------+----------+
| :orange_heart: | 🧡 |
+----------------------------------+----------+
| :yellow_heart: | 💛 |
+----------------------------------+----------+
| :green_heart: | 💚 |
+----------------------------------+----------+
| :blue_heart: | 💙 |
+----------------------------------+----------+
| :purple_heart: | 💜 |
+----------------------------------+----------+
| :brown_heart: | 🤎 |
+----------------------------------+----------+
| :black_heart: | 🖤 |
+----------------------------------+----------+
| :white_heart: | 🤍 |
+----------------------------------+----------+
| :couple_with_heart: | 💑 |
+----------------------------------+----------+
| :couple_with_heart_woman_man: | 👩‍❤️‍👨 |
+----------------------------------+----------+
| :couple_with_heart_man_man: | 👨‍❤️‍👨 |
+----------------------------------+----------+
| :couple_with_heart_woman_woman: | 👩‍❤️‍👩 |
+----------------------------------+----------+
| :hearts: | ♥️ |
+----------------------------------+----------+
```