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 sys | |
from xml.etree import ElementTree | |
import datetime | |
from collections import defaultdict | |
DAY_TITLE_FORMAT = '%A' # '%A %d %B' | |
BLOCK_FORMAT = '{day}-session-block-{num}' # saturday-session-block-1 | |
TSV_FORMAR = '{id}\t{day}\t{title}\t"{abstract}"\t"{persons_list}"\t{persons}\t{room}\t\t{block}\t{space}\t{start}\t{end}\t{link}\t\tTRUE\t"{tags}"\t\t\t\n' |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
""" | |
Bot to replace the manual submission header by a template. | |
Pages provided by a generator. e.g. -catr:2019:Submissions | |
'¶ms;' | |
""" | |
from queue import Queue |
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
The contents of this gist has moved to https://github.com/Wikimedia-Sverige/scripts/tree/master/fortnox_huvudbok_processing | |
where it will also be kept updated. |
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
stockholms universitet, Botaniska institutionen (2011) | |
fysiker (mekanik), universitetslektor vid KTH | |
fil. dr. i nordiska språk | |
beteendevetare, arbetar även med ledningsutveckling | |
rysk författare. Emigrerade efter 1920 | |
skrivit om KFUM-kören i Örebro | |
tysk politiker & ekonom, 1897-1977 | |
kulturredaktör på Norrländska socialdemokraten (1996) | |
litteraturvetare, docent vid Uppsala universitet | |
fransk tonsättare och organist, 1907-1991 |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import argparse | |
import re | |
def clean_log(filename): | |
import codecs | |
f_in = codecs.open(filename, 'r', 'utf-8') | |
f_out = codecs.open('{}.clean'.format(filename), 'w', 'utf-8') | |
bad_warnings = ( |
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/bash | |
# | |
# Script to make a local copy of the last complete log | |
# make a local copy of the logs | |
cp /data/project/heritage/logs/update_monuments.log ./raw.log; | |
# cut log at last complete | |
last_complete=$(grep --binary-files=text -n "Done with the update!" raw.log | tail -n1 | cut -f1 -d:); | |
head -n "$last_complete" raw.log > tmp.log; |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
""" | |
Quick pywikibot wrapper for statement addition. | |
""" | |
import pywikibot | |
PROP = 'P5008' | |
TARGET_Q = 'Q123' | |
REF_PROP = 'P248' |
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
// Backup copy at https://gist.github.com/lokal-profil/31d8651049d1ebf58bc668c7f27ab288 | |
var rangeRef = "Staff!G1" // this is the cell in which the allowed personnel range (on the same sheet) is specified. | |
var delimiterLookup = { | |
"COMMA": ",", | |
"SEMICOLON": ";", | |
"PERIOD": ".", | |
"SPACE": " " | |
} | |
/** |
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
# -*- coding: utf-8 -*- | |
# python check_WLE_id.py -live -dir:~/Projects/batchUploadTools/ | |
"""Script for updating unused imges/unknonw ids pages for WLE on sv.wp.""" | |
import pywikibot | |
import wikidataStuff.wdqsLookup as query | |
SETTING = { | |
'prop': 'P3613', | |
'formatter_url': 'http://skyddadnatur.naturvardsverket.se/sknat/?nvrid={}', | |
'cat': 'Category:Protected areas of Sweden with known IDs', |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# | |
# Cleanup function for a one-time replacement of upper case connections | |
# in Materials, Keywords and ObjKeywords | |
# | |
import helpers | |
import codecs | |
import os |