Skip to content

Instantly share code, notes, and snippets.

View Vesihiisi's full-sized avatar

Alicia Fagerving Vesihiisi

  • Göteborg, Sweden
View GitHub Profile
@Vesihiisi
Vesihiisi / gist:6c4aebdd75c9d78c32872dc0b9873b99
Created April 18, 2024 11:40
OR chunked uploads startup
alicia@WMSE:~/Downloads/OpenRefine-issue-4303-chunked-upload$ ./refine
Using refine.ini for configuration
-------------------------------------------------------------------------------------------------
You have 7830M of free memory.
Your current configuration is set to use 1400M of memory.
OpenRefine can run better when given more memory. Read our FAQ on how to allocate more memory here:
https://openrefine.org/docs/manual/installing#increasing-memory-allocation
-------------------------------------------------------------------------------------------------
01:38:33.794 [ refine_server] Java runtime version 11.0.22+7-post-Ubuntu-0ubuntu222.04.1 from java.home: /usr/lib/jvm/java-11-openjdk-amd64 (0ms)
# -*- coding: utf-8 -*-
"""
Given a quarry.wmcloud.org URL,
process the info from WMSE's SDC upload
project to extract 1) the number of unique
files edited, 2) the number of SDC statements
added.
Dump has to be in this format to be examined:
https://quarry.wmcloud.org/query/59376
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""One trick script to
collate sets of tiff files across multiple
directories into smaller DJVUs.
Used for upload of manuscripts
from Musikverket 2021-05.
"""
import os
from shutil import which # used for djvu conversion
@Vesihiisi
Vesihiisi / add_english_arnberg.py
Last active September 1, 2020 06:51
[T261595] Add link to English website about Arnberg to Musikverket's music files
# -*- coding: utf-8 -*-
"""Add link to English site about Arnberg
https://phabricator.wikimedia.org/T261595
Correct descriptions of files from Musikverket's
Arnberg collection by adding links to their
English website, not only Swedish.
"""
import pywikibot
from pywikibot import pagegenerators as pg
@Vesihiisi
Vesihiisi / check_WLE_id.py
Created May 3, 2020 12:55 — forked from lokal-profil/check_WLE_id.py
Short script for reproducing WLM style reporting pages for Wikidata powered competitions (here WLE in Sweden)
# -*- 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',
{
"Ackté, Aino (1876-1944)": "Aino Ackté",
"Allum, Thorleif (1882-1919)": "Thorleif Allum",
"Andersson, Olga (1876-1943)": "Olga Andersson",
"Arehn, Nils (1877-1928)": "Nils Arehn",
"Baeckström, Anders Oscar Wilhelm (1854-1919)": "Oscar Bæckström",
"Barcklind, Carl (1873-1945)": "Carl Barcklind",
"Berentz, Inga (1878-1962)": "Inga Berentz",
"Berglund, Erik \"Bullen\" (1887-1963)": "Erik Berglund",
"Bergström, Oscar (1874-1931)": "Oscar Bergström",
{
"Djurgårdsteatern": "Djurgårdsteatern",
"Dramatiska teatern": "Kungliga Dramatiska Teatern",
"Folkteatern, Stockholm": "Folkan",
"Kungliga Dramatiska teatern": "Kungliga Dramatiska Teatern",
"Kungliga Operan": "Kungliga operan",
"Kungliga teatern": "Kungliga operan",
"Kungliga teatern (Operan)": "Kungliga operan",
"Mindre teatern": "Mindre teatern",
"Nya teatern": "Svenska teatern, Stockholm",
{
"Alfred Berzelius, Stockholm": {
"commonscat": null,
"creator": null
},
"Alfred Peterson, Göteborg": {
"commonscat": "Alfred Peterson",
"creator": "Alfred Peterson"
},
"Anders Wiklund, Stockholm": {
{
"Adami, Emil (1860-1938)": {
"commonscat": null,
"wikidata": "Q5542227"
},
"Agardh, Hjalmar (1832-1892)": {
"commonscat": "Hjalmar Agardh",
"wikidata": "Q5543350"
},
"Almlöf, Carl Anders Knut (1829-1899)": {
@Vesihiisi
Vesihiisi / add_bracket.py
Created February 1, 2019 09:51
Add missing curly bracket in {{WMSE-GemenskapensProjekt}} template
# -*- coding: utf-8 -*-
import pywikibot
from pywikibot import pagegenerators as pg
edit_summary = "Fix broken template."
site = pywikibot.Site("commons", 'commons')
catname = "Melodifestivalen 2018, Göteborg"
cat = pywikibot.Category(site, catname)
gen = pg.CategorizedPageGenerator(cat)