Skip to content

Commit 3069834

Browse files
committed
Remove required for positional argument
1 parent 44b2438 commit 3069834

File tree

6 files changed

+112
-17
lines changed

6 files changed

+112
-17
lines changed

MANIFEST

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
# file GENERATED by distutils, do NOT edit
2-
setup.cfg
3-
setup.py
4-
altify/__init__.py
5-
altify/altify
1+
include *.rst *.txt *.md LICENSE

altify.egg-info/PKG-INFO

Lines changed: 94 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,101 @@
11
Metadata-Version: 1.1
22
Name: altify
3-
Version: 0.1
3+
Version: 3.9
44
Summary: Uses deep learning to caption img tags within a web page and fills out their alt attribute with the related caption
55
Home-page: https://github.com/parhamp/altify
66
Author: Parham Pourdavood
77
Author-email: [email protected]
8-
License: UNKNOWN
9-
Download-URL: https://github.com/parhamp/altify/tarball/0.1
10-
Description: UNKNOWN
11-
Keywords: alt,caption,images
8+
License: Apache-2.0
9+
Download-URL: https://github.com/parhamp/altify/tarball/3.3
10+
Description: Altify
11+
======
12+
13+
.. image:: https://github.com/ParhamP/altify/blob/master/images/gif.gif?raw=true
14+
15+
Altify automizes the task of inserting alternative text attributes for
16+
image tags. Altify uses Microsoft Computer Vision API's deep learning
17+
algorithms to caption images in an HTML file and returns a new HTML file
18+
in which alt attributes are filled out with their corresponding
19+
captions.
20+
21+
Notice: Altify will now ignore any image tag whose alt attribute has
22+
content or is just an empty string. (In compliance with standard web
23+
practices)
24+
25+
Dependencies
26+
------------
27+
28+
- BeautifulSoup
29+
- Python 2.7
30+
- html5lib
31+
32+
Install and Usage (Latest Version)
33+
----------------------------------
34+
35+
1) Get a Microsoft API Key for Free
36+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37+
38+
https://www.microsoft.com/cognitive-services/en-us/sign-up.
39+
40+
2) Install via pip
41+
~~~~~~~~~~~~~~~~~~
42+
43+
Open up terminal and enter: ``pip install altify``
44+
45+
3) Use
46+
~~~~~~
47+
48+
``altify path_to_your_html api_key``
49+
50+
4) Enjoy!
51+
~~~~~~~~~
52+
53+
A new HTML file called altify.html is created next to the HTML file you
54+
selected. (Or Desktop, when using older versions)
55+
56+
How It was Built
57+
----------------
58+
59+
1. Parses the html using BeautifulSoup.
60+
2. Find all the image tags.
61+
3. Stream images using uploads.im API, and then with its URL, send
62+
request to Microsoft's API to caption.
63+
4. Filter images that are smaller than 200px width.
64+
5. Fill out the alt attributes for all the images.
65+
6. Write an edited HTML file next to the file you selected.
66+
67+
Captioned Images Samples
68+
------------------------
69+
70+
.. image:: https://github.com/ParhamP/altify/blob/master/images/pic.png?raw=true
71+
72+
Donald Trump wearing a suit and tie
73+
74+
.. image:: https://github.com/ParhamP/altify/blob/master/images/piano.jpg?raw=true
75+
76+
A piano keyboard
77+
78+
.. image:: https://github.com/ParhamP/altify/blob/master/images/animal.jpg?raw=true
79+
80+
A squirrel eating
81+
82+
.. image:: https://github.com/ParhamP/altify/blob/master/images/cat.jpg?raw=true
83+
84+
A close up of a cat looking at the camera
85+
86+
.. image:: https://github.com/ParhamP/altify/blob/master/images/lady.jpg?raw=true
87+
88+
A woman wearing a red hat
89+
90+
.. image:: https://github.com/ParhamP/altify/blob/master/images/lake.jpg?raw=true
91+
92+
A small boat in a lake surrounded by mountains
93+
94+
Disclaimer
95+
----------
96+
97+
Humans are currently better at captioning images than machines. Use
98+
responsibly!
99+
100+
Keywords: alt,caption,images,deep learning
12101
Platform: UNKNOWN

altify.egg-info/SOURCES.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
README.rst
2+
setup.py
3+
altify/__init__.py
4+
altify/altify
5+
altify.egg-info/PKG-INFO
6+
altify.egg-info/SOURCES.txt
7+
altify.egg-info/dependency_links.txt
8+
altify.egg-info/requires.txt
9+
altify.egg-info/top_level.txt

altify/altify

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ def apply(html_file, api_key):
199199
def argParser():
200200
parser = argparse.ArgumentParser()
201201
parser.add_argument("html", help="The path to youe html file",
202-
type=str, required=True)
202+
type=str)
203203
parser.add_argument("key", help="Microsoft Cognitive Services Key",
204-
type=str, required=True)
204+
type=str)
205205
args = parser.parse_args()
206206
try:
207207
apply(args.html, args.key)

setup.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

setup.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
from distutils.core import setup
1+
from setuptools import setup
2+
3+
with open("README.rst", "rb") as f:
4+
long_description = f.read()
25

36
setup(
47
name = 'altify',
58
packages=['altify'],
6-
version = '3.3',
9+
version = '3.9',
710
scripts=['altify/altify'],
811
description = "Uses deep learning to caption img tags within a web page and fills out their alt attribute with the related caption",
9-
long_description="Altify automizes the task of inserting alternative text attributes for imgage tags. Altify uses Microsoft Computer Vision API's deep learning algorithms to caption images in an HTML file and returns a new HTML file in which alt attributes are filled out with their corresponding captions.",
12+
long_description=long_description,
1013
author = 'Parham Pourdavood',
1114
author_email = '[email protected]',
1215
url = 'https://github.com/parhamp/altify',

0 commit comments

Comments
 (0)