From 98f42f3ea54f2a3ec3aa75c435d7e53273c96c3c Mon Sep 17 00:00:00 2001 From: Sunim Acharya Date: Sun, 18 Feb 2018 17:54:53 +0545 Subject: [PATCH] Rename to dexter --- README.md | 2 +- main.py | 8 ++++---- setup.py | 13 +++++++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 setup.py diff --git a/README.md b/README.md index 38ff641..6e19569 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/main.py b/main.py index b2a015c..af1ca16 100644 --- a/main.py +++ b/main.py @@ -20,7 +20,7 @@ def __init__(self): print("usage: {} ".format(sys.argv[0])) sys.exit(1) -class saram(object): +class dexter(object): def __init__(self): @@ -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() @@ -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: @@ -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 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..93b4ce2 --- /dev/null +++ b/setup.py @@ -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 = 'sunim.54@gmail.com', + 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 = [], +) \ No newline at end of file