Skip to content

Instantly share code, notes, and snippets.

View BharatKalluri's full-sized avatar
🎯
Focusing

Bharat Kalluri BharatKalluri

🎯
Focusing
View GitHub Profile
@BharatKalluri
BharatKalluri / Football.py
Created February 15, 2017 12:17
MatchScore Notification
import requests
from bs4 import BeautifulSoup
import subprocess
import time
def sendmessage(message):
subprocess.Popen(['notify-send', message])
return
@BharatKalluri
BharatKalluri / keybase.md
Created October 16, 2017 05:03
My Keybase proof

Keybase proof

I hereby claim:

  • I am bharatkalluri on github.
  • I am bharatkalluri (https://keybase.io/bharatkalluri) on keybase.
  • I have a public key ASAhCXbBO7VtiV3EZQ1HD-wUzArgwhRyFdMw_lG3_3qUrQo

To claim this, I am signing this object:

@BharatKalluri
BharatKalluri / spotiLyrics.sh
Created September 26, 2019 04:35
Get lyrics in bash
#!/bin/bash
# Thanks @glutanimate !
SP_DEST="org.mpris.MediaPlayer2.spotify"
SP_PATH="/org/mpris/MediaPlayer2"
SP_MEMB="org.mpris.MediaPlayer2.Player"
LyricsAPI="http://makeitpersonal.co/lyrics/"
@BharatKalluri
BharatKalluri / google_doc_ocr.py
Last active October 20, 2020 19:08
OCR documents from local file system using google vision
#!/usr/bin/env python
import argparse
def detect_text(path):
"""Detects text in the file."""
from google.cloud import vision
import io
client = vision.ImageAnnotatorClient()
@BharatKalluri
BharatKalluri / main.py
Last active April 27, 2021 17:57
IA <-> OL sync
from typing import List, Union
from internetarchive import configure, get_session
from olclient.openlibrary import OpenLibrary
from models import IsbnData
from models import EditionMetadata
class IsbnNotFoundInOl(Exception):
@BharatKalluri
BharatKalluri / isbn-162097066X.json
Created April 27, 2021 10:33
Meta book output as JSON
{
"work": {
"provider_id": 42799938,
"title": "The Boy Who Could Change the World",
"authors": [
{
"name": "Aaron Swartz",
"provider_author_id": 6893150
}
],
@BharatKalluri
BharatKalluri / bwb-import-bot.py
Last active September 7, 2021 06:56
BWB import bot
#!/usr/bin/env python3
import csv
import datetime
import json
import logging
import os.path
import sqlite3
import sys
from enum import Enum
from sqlite3 import Connection, Cursor
@BharatKalluri
BharatKalluri / thingdb.py
Created September 19, 2021 12:23
Toy ThingDB implementation using python and mongodb
import asyncio
from abc import ABC
from enum import Enum
from typing import Optional
from odmantic import AIOEngine
from odmantic import Model
from odmantic.query import SortExpression
@BharatKalluri
BharatKalluri / fuse.ts
Created September 20, 2021 17:10
Fuse: A simple circuit breaker in deno
interface IOptions {
bucketSize: number,
failurePercent: number
canaryRequestInMilliSeconds: number
minRecordings: number
}
interface IEvent {
success: boolean
createdAt: number
@BharatKalluri
BharatKalluri / main.ts
Created September 28, 2021 08:36
AA client
import {v4 as uuidV4} from 'uuid';
import rs from "jsrsasign";
const BASE_URL = 'https://aa-sandbox.setu.co'
class AccountAggregatorClient {
aa_id: string;
fiu_id: string;
client_api_key: string