Skip to content

Commit

Permalink
Rename to dexter
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaminus committed Feb 18, 2018
1 parent 077e54c commit 98f42f3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# saram - Image/PDF OCR conversion
# dexter - Image/PDF OCR conversion
Get OCR in txt form from an image or pdf extension supporting multiple files from directory using pytesseract
8 changes: 4 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self):
print("usage: {} <dirname>".format(sys.argv[0]))
sys.exit(1)

class saram(object):
class dexter(object):

def __init__(self):

Expand Down Expand Up @@ -70,7 +70,7 @@ def pdf_run(self, image_file_name, filename):
except AttributeError as e:
print("Update Wand library: %s" % e)

img_buf = path + '/' + "saram_" + filename + str(page) + ".png"
img_buf = path + '/' + "dexter_" + filename + str(page) + ".png"
img_per_page.save(filename=img_buf)

page_start = time.time()
Expand Down Expand Up @@ -164,7 +164,7 @@ def main(self, path):
print(str(count) + (" file" if count == 1 else " files") + " processed")

for f in os.listdir(path):
if f.startswith("saram_"):
if f.startswith("dexter_"):
os.remove(os.path.join(path, f))

if count + other_files == 0:
Expand All @@ -179,5 +179,5 @@ def main(self, path):
raise ArgumentMissingException
path = sys.argv[1] #python main.py "path_to/img_dir" ie the argv[1] value
path = os.path.abspath(path) #Accesing filesystem for Return a normalized absolutized version of the pathname path
s = saram()
s = dexter()
s.main(path) # Def main to path
13 changes: 13 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from distutils.core import setup
setup(
name = 'dexter',
packages = ['dexter'], # this must be the same as the name above
version = '0.1',
description = 'A library to fetch images from a directory and fetch OCR from it with orientation rotation and pdf support',
author = 'Sunim Acharya',
author_email = '[email protected]',
url = 'https://github.com/aryaminus/dexter', # use the URL to the github repo
download_url = 'https://github.com/aryaminus/dexter/archive/0.1.tar.gz', # I'll explain this in a second
keywords = ['ocr', 'image', 'pdf'], # arbitrary keywords
classifiers = [],
)

0 comments on commit 98f42f3

Please sign in to comment.