Skip to content

Instantly share code, notes, and snippets.

View syedarehaq's full-sized avatar

Syed Arefinul Haque syedarehaq

View GitHub Profile
@rasbt
rasbt / whisper-audio-to-text.py
Created January 26, 2023 17:46
Transcribes audio files using OpenAI Whisper
# Setup:
# conda create -n whisper python=3.9
# conda activate whisper
# https://github.com/openai/whisper
# pip install git+https://github.com/openai/whisper.git
# Usage:
# python whisper-audio-to-text.py --audio_dir my_files --out_dir texts
import argparse
@zobayer1
zobayer1 / elastic_scroll.py
Last active November 14, 2020 23:26
Simple generator function to download Elasticsearch index data using scroll query
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests
class ElasticScroll(object):
"""Manages scroll contexts for elasticsearch scroll queries.
Args:
host (str): Elasticsearch host url. Example: ``http://localhost:9200``.
index (str): Elasticsearch index name. Example: ``my_index``.
@olih
olih / jq-cheetsheet.md
Last active May 15, 2024 22:26
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@mdweaver
mdweaver / chronicling_america-scraper.py
Created February 12, 2015 16:36
Script to search Chronicling America archive
#Script for scraping Chronicling America
import requests
import re
import csv
from bs4 import BeautifulSoup, SoupStrainer
import os
from time import sleep
from datetime import date, datetime, timedelta
#search_terms is a string of words separated by spaces.