Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Nobutake Kamiya NbtKmy

🏠
Working from home
View GitHub Profile
View imgToPdf_einzel.py
#!/usr/bin/env python3
import os
from PIL import Image
if __name__ == "__main__":
num = 1
for i in os.listdir('./img'):
filename = './img/' + i
View test.py
#!/usr/bin/env python3
import urllib.request
import json
import sys
from PIL import Image
import requests
from io import BytesIO
import cv2
import numpy as np
import img2pdf
View iiifDLtoGRImg.py
#!/usr/bin/env python3
import urllib.request
import json
import sys
from PIL import Image
import requests
from io import BytesIO
import cv2
import numpy as np
import img2pdf
View iiifDLtoGRImg.py
#!/usr/bin/env python3
import urllib.request
import json
import sys
from PIL import Image
import requests
from io import BytesIO
import cv2
import numpy as np
import img2pdf
View imgToPdf.py
#!/usr/bin/env python3
import os
from PIL import Image
if __name__ == "__main__":
im_list = []
for i in os.listdir('./img'):
filename = './img/' + i
imgs = Image.open(filename)
View grey_and_binarize.py
#!/usr/bin/env python3
import cv2
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Pre-process for OCR')
parser.add_argument('input', help='Name of original image')
parser.add_argument('output', help='Name of output image')
args = parser.parse_args()
View iiifDL.py
#!/usr/bin/env python3
import urllib.request
import json
import sys
from PIL import Image
import requests
from io import BytesIO
import argparse
View test2_manifest.json
{
"@context": "http://iiif.io/api/presentation/2/context.json",
"@id": "http://91d111ec-49ff-40c5-bd1e-fd3bdecee82d",
"@type": "sc:Manifest",
"label": "my favorit things",
"metadata": [],
"description": [
{
"@value": "... my favorit images",
"@language": "en"
View manifest.json
{
"@context": "http://iiif.io/api/presentation/2/context.json",
"@id": "http://91d111ec-49ff-40c5-bd1e-fd3bdecee82d",
"@type": "sc:Manifest",
"label": "my favorit things",
"metadata": [],
"description": [
{
"@value": "... my favorit images",
"@language": "en"
@NbtKmy
NbtKmy / check_gnd.py
Last active Jan 20, 2021
Checking persons in the snf list with gnd api
View check_gnd.py
import pandas as pd
import requests
df = pd.read_csv('snf_person.csv', sep=',')
df['viaf'] = 'NaN'
df['orcid_gnd'] = 'NaN'
df['gnd'] = 'NaN'
df['ambiguity'] = 0