Skip to content

Instantly share code, notes, and snippets.

@vinovator
vinovator / ConsolidatePDF.py
Created April 5, 2020 20:01
From a given folder, consolidate all PDFs into one
# -*- coding: utf-8 -*-
"""
Python 3
ConsolidatePDF.py
From a given folder, consolidate all PDFs into one
"""
from PyPDF2 import PdfFileMerger
import os
@vinovator
vinovator / Consolidate_excel_sheets_with formatting
Created April 30, 2019 21:02
Parse through multiple excel files in a folder hierarchy and consolidate Using win32com library so that sheets get copied with formatting intact
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 16 15:45:52 2019
@author: Vinoth_Subramanian
Parse through multiple excel files in a folder heirarchy and consolidate
Using win32com library so that sheets get copied with formatting intact
"""
import os
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 16 15:45:52 2019
@author: Vinoth_Subramanian
Parse through multiple excel files in a folder heirarchy and consolidate
Only limitation - Since the copy is done through pandas, only the values -
- from the sheets will be copied. Formulas and formatting will be ignored
"""
@vinovator
vinovator / azure_ocr.py
Last active July 27, 2017 20:07
Python script to analyze and read text from image URLs using Micorost Azure Cognitive services OCR API
# azure_ocr.py
# Python 3.5
"""
Python script to analyze and read text from image URLs using Micorost Azure Cognitive services OCR API
"""
from IGNORE import azure_secrets # To fetch API endpoint and key
import requests
import json
@vinovator
vinovator / wma_finder.py
Created March 29, 2017 09:23
Find files of a specific extension from a root directory and delete them !!
# wma_finder.py
# Python 3.5
import os
path = "D:\Vinoth\Songs"
file_extn = ".wma
file_count = 0
with open(path + "\wma_deleted.txt", "a") as del_log:
# UKBschools.py
# Python 3.5
"""
Scrap the list of all accredated BSchools in UK from find-mba.com
export the list to excel
"""
import requests
# uk_mba.py
# Python 2.7.6
"""
Extract business schools in UK with AACSB, AMBA and/or EQUIS accredition only
Scapring from http://find-mba.com/
"""
import requests
from bs4 import BeautifulSoup
@vinovator
vinovator / vinbot.py
Created August 25, 2016 00:05
Python script to listen and respond to commands sent to Telegram bot. Uses telepot library.
# vinbot.py
# Python 3.5
"""
@vin_robot is my telegram bot; telegram.me/vin_robot
This python script listens to commands sent to bot and responds accordingly
"""
import telepot
@vinovator
vinovator / vin_bot_hello.py
Created August 17, 2016 15:23
Python app to interact with Telegram bot
# vin_bot_hello.py
# Python 2.7.6
"""
Python app to interact with Telegram bot
"""
import telepot
import time
@vinovator
vinovator / print_docs.py
Created May 26, 2016 17:10
Print all documents from set of folders using default printer
# print_docs.py
# Python 2.7.6
"""
Print all documents from set of folders using default printer
"""
import os
import win32print
import win32api