├── zalgo ├── __init__.py ├── zalgo.py └── __main__.py ├── requirements.txt ├── .gitignore ├── MANIFEST.in ├── LICENSE ├── README.md └── setup.py /zalgo/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | xerox==0.4.1 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.sw[a-p] 2 | *.pyc 3 | *.egg-info/ 4 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.md LICENSE requirements.txt 2 | recursive-include emo *.py 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Rich Jones 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /zalgo/zalgo.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # This file is written by Mike Giarlo @mjgiarlo - https://github.com/mjgiarlo 4 | # Thanks, Mike! 5 | 6 | from random import randint, choice 7 | 8 | try: 9 | chr = unichr 10 | except NameError: 11 | pass # Cause we're on Python3 12 | 13 | 14 | def zalgo(text, intensity=50): 15 | zalgo_threshold = intensity 16 | zalgo_chars = [chr(i) for i in range(0x0300, 0x036F + 1)] 17 | zalgo_chars.extend([u'\u0488', u'\u0489']) 18 | source = text 19 | if not _is_narrow_build: 20 | source = _insert_randoms(source) 21 | zalgoized = [] 22 | for letter in source: 23 | zalgoized.append(letter) 24 | zalgo_num = randint(0, zalgo_threshold) + 1 25 | for _ in range(zalgo_num): 26 | zalgoized.append(choice(zalgo_chars)) 27 | response = choice(zalgo_chars).join(zalgoized) 28 | return response 29 | 30 | 31 | def _insert_randoms(text): 32 | random_extras = [unichr(i) for i in range(0x1D023, 0x1D045 + 1)] 33 | newtext = [] 34 | for char in text: 35 | newtext.append(char) 36 | if randint(1, 5) == 1: 37 | newtext.append(choice(random_extras)) 38 | return u''.join(newtext) 39 | 40 | 41 | def _is_narrow_build(): 42 | try: 43 | chr(0x10000) 44 | except ValueError: 45 | return True 46 | return False 47 | -------------------------------------------------------------------------------- /zalgo/__main__.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | from __future__ import print_function 3 | 4 | import argparse 5 | import sys 6 | import xerox 7 | from . import zalgo 8 | 9 | 10 | def convert_zalgo(text, intensity=50, copy=False): 11 | input_text = u' '.join(text) 12 | zalgotext = zalgo.zalgo(input_text, intensity) 13 | 14 | if copy: 15 | xerox.copy(u'' + zalgotext) 16 | 17 | return zalgotext 18 | 19 | 20 | def get_parser(): 21 | parser = argparse.ArgumentParser(description='Command line zalgo.') 22 | parser.add_argument('text', metavar='TEXT', type=str, nargs='*', 23 | help='the text to zalgo') 24 | parser.add_argument('-c','--copy', help='copy result to the clipboard.', 25 | default=False, dest='copy', action='store_true') 26 | parser.add_argument('-i','--intensity', 27 | help='Intensity of zalgo. 1-200. Default 50.', 28 | choices=range(1, 201), default=50, type=int) 29 | 30 | return parser 31 | 32 | 33 | def command_line_runner(): 34 | parser = get_parser() 35 | args = parser.parse_args() 36 | if not args.text: 37 | parser.print_help() 38 | return 39 | else: 40 | zalgotext = convert_zalgo(args.text, args.intensity, args.copy) 41 | 42 | if not args.copy: 43 | print(zalgotext) 44 | 45 | 46 | 47 | if __name__ == '__main__': 48 | command_line_runner() 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # z̟̜ͯ̐ͯͯͯͯ̑ͯͤͯ͊ͯͯa̵̩ͯͯͯ͊ͯ̉ͯl̷ͯ̀ͯͯ҈̪͉̳ͯ̒ͯͯͤͯͯ͒ͯͯ҉͈ͯ̽ͯ̋ͯͯg̣ͯͯo̢̫͉̮͇̭͈͖̺̼͙̣ͯͯͯ́ͯ̒ͯ́ͯͯͯͯͯͯͯͯͯ̒ͯͯͯͯͯ̑ͯ̿̕͝ 2 | 3 | Command line zalgo. 4 | 5 | # Installation 6 | 7 | pip install zalgotext 8 | 9 | # Usage 10 | 11 | $ zalgo hail satan 12 | 13 | h̸͕̰͓̺ͭ̔ͭͭͭͭ͐ͭ̎ͭ́ͭͭ̔ͭͮͭ̋ͭͭ͏̴̨̡̱̤̞̥̺̜ͭͭͭͭ̿ͭ̆ͭ̔ͭͭ̏ͭͪͭ̓ͭͭͭͭ͑ͭͭ͑ͭͭͭ͗ͭͭ͆ͭͭ̂ͭͭ͐ͭ̕͠͝͠a̶̶̫̲͎ͭͭͦͭͭͭͭ̉ͭ̆ͭͭͤͭi̞ͭͭ͒ͭ̋ͭ̇ͭ̾ͭ҉̵̣͕̩͚̯̟̱ͭ̾ͭͯͭͭͭͭͭͭͭͨͭͭͭͭ͘l̮ͭͭ͛ͭ͗ͭͭ̓ͭͣͭ̒ͭ͞ ̷̸̡̮̺͖̖̜̜̻̺͎̝̼ͭ̃ͭ̃ͭͭͭ̌ͭͭͭ̽ͭͭͥͭ͛ͭͭͭͭͭͭ̂ͭͭͭͭ̈ͭ́ͭ̓ͭͭ̔ͭ̋ͭͭͭͭͭͭͭͭ̌ͭ̚̕͢͠ͅ҉ͭsͭ҉̡̺͚ͭ͛ͭ̍ͭͭͭͭͭ̕a͎̩̯̪̝͇̳̬͎̙͎̯ͭ̾ͭͭͭ͂ͭͭͭͭͭͭͭͭͩͭ̌ͭͭͭͭ̄ͭ̾ͭt̹ͭͧͭͭͬͭaͭ̔ͭ҈̶͕̙̣͈ͭͭͭͭ̏ͭͭͭͭͭͤͭͮͭ͜͞nͭ҉̵̸͕̣͉̟̥ͭͭ͌ͭͭͭͭ̊ͭͭͭ̄ͭͭͭͭ̆ͭ̇ͭ́ͭ͢͡҉̡̢̢̛̥̺͚͓͔͚̫͚̦̦̺ͭͭ͊ͭͭͭ̀ͭ͌ͭͭͭͭͧͭͭͭ̊ͭͭ̉ͭ͑ͭ͛ͭͭͭͭͭ̓ͭͭ 14 | 15 | Zalgo can also copy straight to the clipboard: 16 | 17 | $ zalgo cthulu lives --copy 18 | 19 | č̻̻t̻̩̻̻͍̻̻̭̻̻̄̄̎h̨̻̻̻̻̻̙̻̻̻̣̻͓̻̻̻̻̻̻͔̻̝̻̅ͣ̀̂̆̾ͫ̀ͅͅu̻̻ͦl̻̻̭̻̀u̻҈̻͚̻̻̻̭̻̳̻̻̦̻̻̄́͠͞͏̨̛̻̻̻̻̻̻̻̻̻̘̻̻̻̲̻̖̻̻͕̻̻̻̻͚̻̻̜̻̻͐̀̊͛ͬͧ́̑̆͂ͩ̇̚͜ ̻̻̆͏̻̱̻̫̻̟̻̻͐͏̷̷̷̡̢̧̡̻̮̻̻̻̟̻̻̻̻̻̻̻̻̗̻̞̻̻̻̺̻̭̻̻̻̻̙̻̤̻̪̻̻̻̻̻̻̻̻̦̻̠̻̻̻͖̻̉̐̀̎ͪ̇̃̀ͧ͗ͥͮ̕͘͘͡l̵̨̻̲̻̻̤̻̻̻̻̻̻̻̮̻̻͍̻͈̻̻̮̻̻̭̻͑͋̌ͮ͆ͧ͜ͅ͏̻̻̻̻͖̻̻͉̻̻̻ͤͪ̾ͫ̑̚i̻̬̻̪̻҉̶̸̡̻̻̻̻̻̻̻̝̻̻̻̻̻̻̱̻̻̞̻̗̻̻̱̻̻̩̻̤̻̻̻̻̮̻́̎ͫ͋ͣ̓̿ͪ̄̿̓͑̚͢v̻̻̻̻̻ͥ̈ͫͨ҈̧̻̻̯̻̫̻̻̻̞̻̻̻͎̻̯̻̻̻̻̻̻͓̻͍̻̻̻̻̠̻̤̻̻ͮ͒ͫ̇͋̆̓ͪ̔̊̚͘ͅe̻͔̻̜̻͈̻͉̻s̴̢̻̻̻̻̻̻̞̻̳̻̻̻̻̱̻͖̻̻̝̻̤̻̻̣̻̻̻̪̻̻̻̥̻̻̈́̊ͬ̆ͩ̓ͪ̃̄̓ͅ͏̧̻͕̻̩̻̻̻̯̻̻̻̺̻͉̻̻̻̦̻̻̤̻̻͓̻̺̻̠̻͕̊̂̔̂̑̐̽ 20 | 21 | 22 | And that's all it does! 23 | 24 | # See Also 25 | 26 | * [Emo](https://github.com/Miserlou/Emo) 27 | * [Vape](https://github.com/Miserlou/Vape) 28 | * [Trapify](https://github.com/Miserlou/Trapify) 29 | 30 | Rich Jones 2015. Based on [@mjgiarlo](https://github.com/mjgiarlo)'s pyzalgo. 31 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | from setuptools import setup 3 | 4 | # Set external files 5 | README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read() 6 | with open(os.path.join(os.path.dirname(__file__), 'requirements.txt')) as f: 7 | required = f.read().splitlines() 8 | 9 | # allow setup.py to be run from any path 10 | os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) 11 | 12 | setup( 13 | name='zalgotext', 14 | version='0.2.0', 15 | packages=['zalgo'], 16 | install_requires=required, 17 | include_package_data=True, 18 | license='MIT License', 19 | description='Terminal zalgo.', 20 | long_description=README, 21 | url='https://github.com/Miserlou/zalgo', 22 | author='Rich Jones', 23 | author_email='rich@openwatch.net', 24 | entry_points={ 25 | 'console_scripts': [ 26 | 'zalgo=zalgo.__main__:command_line_runner', 27 | ] 28 | }, 29 | classifiers=[ 30 | 'Environment :: Console', 31 | 'License :: OSI Approved :: MIT License', 32 | 'Operating System :: OS Independent', 33 | 'Programming Language :: Python', 34 | 'Programming Language :: Python :: 2.6', 35 | 'Programming Language :: Python :: 2.7', 36 | 'Programming Language :: Python :: 3.0', 37 | 'Programming Language :: Python :: 3.1', 38 | 'Programming Language :: Python :: 3.2', 39 | 'Programming Language :: Python :: 3.3', 40 | 'Programming Language :: Python :: 3.4', 41 | 'Programming Language :: Python :: 3.5', 42 | 'Programming Language :: Python :: 3.6', 43 | ], 44 | ) 45 | --------------------------------------------------------------------------------