Skip to content

Instantly share code, notes, and snippets.

@rlskoeser
rlskoeser / csv2georss.py
Last active December 12, 2015 01:48
Script to generate GeoRSS from CSV files generated by NameDropper lookup-names script. See http://disc.library.emory.edu/networkingbelfast/places-in-around-the-world-in-80-days/
#!/usr/bin/env python
# to get dependencies: pip install unicodecsv eulxml namedropper
# as of 2012/02/01 this requires the development version of namedropper,
# but should work with the 0.3 version once it is released
from collections import OrderedDict
import glob
import unicodecsv
from datetime import datetime

Keybase proof

I hereby claim:

  • I am rlskoeser on github.
  • I am suttonkoeser (https://keybase.io/suttonkoeser) on keybase.
  • I have a public key whose fingerprint is 2FA1 F3B7 C4D1 75AA 5047 EEB7 DB03 FB07 2878 158B

To claim this, I am signing this object:

@rlskoeser
rlskoeser / oaipmh-count.py
Last active July 19, 2024 11:18
Script to count records returned by an OAI-PMH provider
#!/usr/bin/env python
"""
A simple command line script to count the number of records returned by an OAI-PMH provider
OAI-PMH protocol documentation: https://www.openarchives.org/OAI/openarchivesprotocol.html
To install dependencies:
pip install lxml requests beautifulsoup4
#!/usr/bin/env python
# fedora 4 test client
# NOTE: this is experimental / spike code!!
# (written to get a sense of the fedora 4 LDP API)
import requests
import rdflib
DC = rdflib.Namespace('http://purl.org/dc/elements/1.1/')
@rlskoeser
rlskoeser / zotero-rdf-tags.py
Created November 3, 2016 16:28
Python script to generate CSV summary data from a Zotero RDF library export
#! /usr/bin/env python
# simple script to pull data from a Zotero library RDF export
# and generate a CSV file with identifier, type of item, title,
# date, and the number of tags
#
# Only supports book and bookSection item types, all other items are ignored
#
# The CSV file will be generated with the same base name as the
# RDF input file.
@rlskoeser
rlskoeser / asana-post-commit.py
Last active September 7, 2021 20:23
python git post-commit hook for Git/Asana integration
#!/usr/bin/env python
# git post-commit hook for linking git commits to asana tasks
# (inspired / adapted in part from https://github.com/Darunada/git-asana-post-commit-hook)
#
# Tested with Python 2.7 and Python 3.5
#
# INSTALLATION
# - Copy this script to .git/hooks/post-commit in your local repository
# (be sure the script is executable)
@rlskoeser
rlskoeser / cdh-scrape.py
Last active September 12, 2018 18:07 — forked from meg-codes/cdh-scrape.py
A basic web-scrape script designed to get summary information an all resources on a site; includes a report of bad links
#!/usr/bin/env python
# Script to scrape all links from a site, compile counts of each link, status
# codes of access and output the results as a CSV
#
# There's absolutely no reason this shouldn't be pulled into an OOP paradigm
# per se, but I left it functionalized because that can be easier for multitasking.
#
# Requirements:
# requests, bs4
@rlskoeser
rlskoeser / sonify-derrida-references.py
Last active December 24, 2019 17:05
script to sonify references from Derrida's Of Grammatology
#!/usr/bin/env python
# Based on sample script from https://programminghistorian.org/en/lessons/sonification#miditime
# currently written for python2; miditime only goes up to python 3.4
# pip install miditime
import csv
from collections import defaultdict
@rlskoeser
rlskoeser / dhqa_data.py
Last active May 4, 2020 21:32
Script to generate dataset from DH Q&A archive (preliminary)
#!/usr/bin/env python
'''
Script to parse data DH Q&A archive.
Install python dependencies:
pip install beautifulsoup4 feedparser
Clone DH Q&A archive repository:
#!/usr/bin/env python
# pip install google-cloud-vision
# Follow quick start instructions to set up access to the API and authentication
# https://pypi.org/project/google-cloud-vision/
import glob
import io
import os