Skip to content

Commit

Permalink
adding to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-rands committed Dec 13, 2019
1 parent 4cafa52 commit d43adb5
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
__pycache__
build
dist
*.pyc
emojify.egg-info
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,25 @@

Obfuscate your python script (or indeed any plain text file) by converting an input script to an output script that functions the same (hopefully) but encodes the code as emoji icons, currently emoticons or emojis.

**Installation**

`pip install emojify`

If installation fails with `pip` for some reason, you can just clone the repository, since there are no dependancies apart from python 3:
```
git clone https://github.com/chris-rands/emojify
cd emojify
```

**Usage**

`python emojify.py --input input_script.py --output output_script.py`
`emojify --input input_script.py --output output_script.py`

For help:
`python emojify.py --help`
`emojify --help`

For unit testing:
`python test_emojify.py`
`test_emojify`

**Example**

Expand All @@ -23,7 +33,7 @@ For unit testing:
return n1 + n2
print('4 + 4 = {}'.format(add(4,4)))

running `python emojify.py --input input_script.py --output output_script.py`
running `emojify --input input_script.py --output output_script.py`

`output_script.py` contains:

Expand Down Expand Up @@ -56,7 +66,7 @@ running `python output_script.py` outputs:
hello world
4 + 4 = 8

similarly, running `python3 emojify.py --input input_script.py --output output_script.py --emoji`
similarly, running `emojify --input input_script.py --output output_script.py --emoji`

`output_script.py` contains:

Expand Down
7 changes: 7 additions & 0 deletions emojify
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-

import emojify

args = emojify.run_argparse()
emojify.main(args.input, args.output, args.emoji)
9 changes: 1 addition & 8 deletions emojify.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

"""
emojify.py
Obfuscate your python script (or indeed any plain text file) by converting an
input script to an output script that functions the same (hopefully) but
encodes the code as emoji icons, currently emoticons or emojis.
"""

import argparse
from pprint import pformat

Expand Down Expand Up @@ -88,6 +80,7 @@ def main(in_file, out_file, emoji):
with open(in_file) as in_f, open(out_file, "w") as out_f:
# Assumes it's ok to read the entire input file into memory
out_f.write(encode_string(in_f.read(), alphabet))
print("done {}".format(alphabet[0]))


if __name__ == "__main__":
Expand Down
24 changes: 24 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import setuptools

with open("README.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="emojify",
version="0.5",
license="MIT",
scripts=["emojify", "emojify.py", "test_emojify"],
author="Chris Rands",
author_email="c_rands100@hotmail.com",
description="Obfuscate your python script by converting it to emoji icons",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/chris-rands/emojify",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.6",
)
2 changes: 1 addition & 1 deletion test_emojify.py → test_emojify
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-

"""
Expand Down

0 comments on commit d43adb5

Please sign in to comment.