Skip to content

Instantly share code, notes, and snippets.

@vinovator
vinovator / mongo_test_restaurants.py
Created March 17, 2016 16:08
Script to interact with MongoDB using pymongo driver
# mongo_test_restaurants.py
# Python 2.7.6
"""
Test script to connect to MongoDB collections using pymongo library
Connects to an already imported connection named "restaurants"
source - https://docs.mongodb.org/getting-started/python/
"""
from pymongo import MongoClient, ASCENDING, DESCENDING
@vinovator
vinovator / uk_mba.py
Created April 7, 2016 14:44
Scraper to extract Bschool information from find-mba.com
# 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 BeautifulSoup import BeautifulSoup
@vinovator
vinovator / mailbot.py
Last active April 19, 2016 20:57
Mail bot sript that sends predefined response to predefined mails. Intended for raspberry pi, which has its dedicated mail id
# mailbot.py
# python 2.7.6
"""
Mail bot sript that sends predefined response to predefined mails
Intended for raspberry pi, which has its dedicated mail id
Algorithm
1) Check a dedicated mailbox inbox for "unread" mails
2) For each "unread" mail, fetch the sender, subject and content
@vinovator
vinovator / crawler.py
Created April 29, 2016 13:50
Crawl a page and extract all urls recursively within same domain
# crawler.py
# Python 2.7.6
"""
Crawl a page and extract all urls recursively within same domain
"""
from BeautifulSoup import BeautifulSoup
@vinovator
vinovator / nltk_name_classifier.py
Last active August 10, 2023 07:36
Classifier to determine the gender of a name using NLTK library
# nltk_name_classifier.py
# Python 2.7.6
"""
Classifier to determine the gender of a name using NLTK library
Classification - task of choosing the correct class label for a given input.
Supervised classifier:
Classifier that is built on training corpora containing the correct label
@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
@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 / 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
# 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
# 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