This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # sqlite> .schema | |
| # CREATE TABLE thumbs(filename, data); | |
| from PIL import Image | |
| import os | |
| from io import BytesIO | |
| import sys | |
| import sqlite3 | |
| from progress.bar import Bar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Keybase proof | |
| I hereby claim: | |
| * I am epoz on github. | |
| * I am epoz (https://keybase.io/epoz) on keybase. | |
| * I have a public key ASAX-cAXJOiDTnX1CA73U80bpWL-sbX1XNsQGvWVi3BLZAo | |
| To claim this, I am signing this object: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import iconclass | |
| import textbase | |
| import sys | |
| from progress.bar import Bar | |
| d = textbase.parse(sys.argv[1]) | |
| bar = Bar('Processing', max=len(d)) | |
| def is_in_there(notation, notations): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| # Export details from a collection of dmp files found at a certain path to a csv file | |
| import os | |
| import iconclass | |
| import sys | |
| from progress.bar import Bar | |
| import textbase | |
| print('Reading files...') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import xml.etree.ElementTree as ET | |
| from progress.bar import Bar | |
| buf = [] | |
| errors = [] | |
| def g(filepath, doc, path): | |
| elem = doc.find(path) | |
| if elem is None: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| import re | |
| import math | |
| import random | |
| import PIL.Image | |
| import warnings | |
| import json | |
| from progress.bar import Bar | |
| import textbase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| codes = ['31D11222', '34B11', '45(+26)', '45C1', '45D12', '48C7341'] | |
| codes = [urllib.quote(x) for x in codes] | |
| paths = set() | |
| for obj in json.loads(urllib2.urlopen('http://iconclass.org/json/?notation='+'¬ation='.join(codes)).read()): | |
| paths.update(obj.get('p')) | |
| paths.add(obj.get('n')) | |
| txts = [] | |
| kws = set() | |
| for p in json.loads(urllib2.urlopen('http://iconclass.org/json/?notation='+'¬ation='.join(paths)).read()): | |
| txts.append(p.get('txt').get('de', u'')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ElasticSearchPaginatorListException(Exception): | |
| pass | |
| class ElasticSearchPaginatorList(object): | |
| def __init__(self, client, *args, **kwargs): | |
| self.client = client | |
| self.args = args | |
| self.kwargs = kwargs | |
| self._count = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!./bin/python | |
| from reportlab.pdfgen import canvas | |
| from reportlab.lib.pagesizes import A4 | |
| from reportlab.lib.units import cm | |
| from reportlab.pdfbase import pdfmetrics | |
| from reportlab.pdfbase.ttfonts import TTFont | |
| from PIL import Image | |
| import PIL | |
| import os | |
| import json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Working out number of quires from a STCN collation | |
| examples = [ | |
| {coll:'[*]2 2*-4*4 A-3Q4 2*2 `︠LO`3Q2 3R-5S4 5T2 5V-5Y4, 2A-G4 2H2 2I4 (3Q4 blank; lacks 3*4, blank?)', | |
| url:'http://picarta.pica.nl/xslt/DB=3.11/XMLPRS=Y/PPN?PPN=318093766', | |
| req:121, | |
| # A-Z 23, A-Z 23, A-Q 16, Q 1, R-Z 7, A-Z 23, A-S 18, T 1, V-Y 3, A-G 7, H 1, I 1, | |
| }, | |
| {coll:'A-V8 W8 X-Z8', # if W found, then noted 'loose' like A-V8 W8 X-Z8 | |
| req:24} | |
| ] |