From 9b9a7180c2592e7a35bc18a5d0fae6879a04d9c2 Mon Sep 17 00:00:00 2001 From: Klaus Thoden Date: Mon, 9 Oct 2017 09:24:50 +0200 Subject: [PATCH] Initial commit --- .gitignore | 3 + bibtex_search.py | 93 +++++++++ data/15_maennig.bib | 478 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 574 insertions(+) create mode 100644 .gitignore create mode 100644 bibtex_search.py create mode 100644 data/15_maennig.bib diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c794357 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +auto/ +doc/ +__pycache__/ diff --git a/bibtex_search.py b/bibtex_search.py new file mode 100644 index 0000000..dd32a9e --- /dev/null +++ b/bibtex_search.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8; mode: python -*- + +__version__ = "1.0" +__date__ = "20171006" +__author__ = "kthoden@mpiwg-berlin.mpg.de" + +import re +import bibtexparser + +bibtexfile = "data/15_maennig.bib" + +# find references in XML file +# look up reference in database (Author and Year) + +def parse_bibtex(bibfile): + """Parse the bibtex file, return a dict""" + + with open(bibfile) as btf: + btb = bibtexparser.load(btf) + tmp_dict = btb.entries_dict + + return tmp_dict +# def parse_bibtex ends here + +def search_bibtex(search_string, bibdict): + """Find the right entry in database + + Try different methods. A standard way is to encode author and year + in the citekey. That's a cheap method for a first try. + """ + + import difflib + + normalized_string = re.sub(r'\s+', '', search_string) + + citekeys = bibdict.keys() + + for entries in bibdict: + print(entries) + + # or use a similarity measure + candidates = difflib.get_close_matches(search_string, citekeys) + print(candidates) + + for key in citekeys: + if key == normalized_string: + bibtex_entry = key + + return bibtex_entry +# def search_bibtex ends here + +def get_local_lyrics_fuzzy(cached_lyrics, song): + """Look for similar titles.""" + import difflib + + other_songs, devnull = get_all_files(ROOT_DIR + "/" + song.artist) + candidates = difflib.get_close_matches(song.title + SUFFIX, other_songs) + # old_lyrics_filename = song.title + SUFFIX + count = 1 + if candidates: + sys.stdout.write(_("Found \n")) + for i in candidates: + sys.stdout.write(_("%s. %s\n") % (count, i.replace(SUFFIX,""))) + count += 1 + answer = input(_("""Does one of those (1 - %s) fit?\nTo abort, just press Enter: """) % (count - 1)) + if answer: + alternate_lyrics = "%s/%s/%s" % (ROOT_DIR, song.artist, candidates[int(answer) - 1 ]) + logging.info(_("Getting lyrics for %s (%s by %s) from %s\n") % + (song.filename, song.title, song.artist, alternate_lyrics)) + file_string = open(alternate_lyrics,"r") + else: + file_string = "" + else: + file_string = "" + + return file_string +# def get_local_lyrics_fuzzy ends here + +def main(): + """The main bit""" + + bibdict = parse_bibtex(bibtexfile) + + result = search_bibtex("Daston 2005", bibdict) + + print(result) +# def main ends here + +if __name__ == '__main__': + main() +# finis + diff --git a/data/15_maennig.bib b/data/15_maennig.bib new file mode 100644 index 0000000..08f4451 --- /dev/null +++ b/data/15_maennig.bib @@ -0,0 +1,478 @@ +%% This BibTeX bibliography file was created using BibDesk. +%% http://bibdesk.sourceforge.net/ + + +%% Created for Bendix Düker at 2017-07-17 11:29:21 +0200 + + +%% Saved with string encoding Unicode (UTF-8) + + + +@book{Ball2013, + Author = {Ball, Philip}, + Keywords = {Baernighausen}, + Publisher = {University of Chicago Press}, + Title = {Curiosity: How Science Became Interested in Everything}, + Year = {2013}} + +@book{Barthes1981, + Address = {New York}, + Author = {Roland Barthes}, + Keywords = {Baernighausen}, + Publisher = {Macmillan}, + Title = {Camera Lucida: Reflections on Photography}, + Year = {1981}} + +@book{Benedict2001, + Address = {Chicago}, + Author = {Barbara M. Benedict}, + Keywords = {Baernighausen}, + Publisher = {University of Chicago Press}, + Title = {Curiosity: A Cultural History of Early Modern Inquiry}, + Year = {2001}} + +@book{Caraffa2011, + Address = {Deutscher Kunstverlag}, + Editor = {Costanza Caraffa}, + Keywords = {Baernighausen}, + Publisher = {Munich}, + Title = {Photo Archives and the Photographic Memory of Art History}, + Year = {2011}} + +@article{Castro2015, + Author = {Francesca di Castro}, + Journal = {Strenna dei Romanisti}, + Keywords = {Baernighausen}, + Langid = {italian}, + Pages = {203–216}, + Title = {Il gusto di un’epoca e la Galleria Sangiorgi}, + Volume = {76}, + Year = {2015}} + +@book{CookSchwartz2002, + Editor = {Terry Cook and Joan M. Schwartz}, + Keywords = {Baernighausen}, + Publisher = {International Journal on Recorded Information}, + Title = {Archives, Records, and Power: Monographic Issue of Archival Science}, + Volume = {Vol.\ 1 (issues 1–2), vol.\ 2 (issues 3–4)}, + Year = {2002}} + +@article{Daston1995, + Author = {Lorraine Daston}, + Journal = {Word \& Image. A Journal of Verbal/Visual Enquiry}, + Keywords = {Baernighausen}, + Number = {4}, + Pages = {391–404}, + Title = {Curiosity in Early Modern Science}, + Volume = {11}, + Year = {1995}} + +@book{DastonPark1998, + Address = {New York}, + Author = {Lorraine Daston and Katharine Park}, + Keywords = {Baernighausen}, + Publisher = {Zone Books}, + Title = {Wonders and the Order of Nature 1150–1750}, + Year = {1998}} + +@article{Daston2005, + Author = {Lorraine Daston}, + Journal = {London Review of Books}, + Keywords = {Baernighausen}, + Number = {12}, + Pages = {37–38}, + Title = {All Curls and Pearls, review of Neil Kenney, \emph{The Uses of Curiosity in Early Modern France and Germany}, Oxford 2004}, + Volume = {27}, + Year = {2005}} + +@book{DastonGalison2007, + Address = {New York}, + Author = {Lorraine Daston and Peter Galison}, + Keywords = {Baernighausen}, + Publisher = {MIT Press}, + Title = {Objectivity}, + Year = {2007}} + +@book{EdwardsHart2004, + Address = {London}, + Editor = {Elizabeth Edwards and Janice Hart}, + Keywords = {Baernighausen}, + Publisher = {Routledge}, + Title = {Photographs Objects Histories: On the Materiality of Images}, + Year = {2004}} + +@incollection{Edwards2013, + Address = {New York}, + Author = {Elizabeth Edwards}, + Booktitle = {Distance and Desire: Encounters with the African Archive}, + Editor = {Tamar Garb}, + Keywords = {Baernighausen}, + Pages = {48–54}, + Publisher = {Steidl}, + Title = {Looking at Photographs: Between Contemplation, Curiosity and Gaze}, + Year = {2013}} + +@book{Kenney2004, + Address = {Oxford}, + Author = {Neil Kenney}, + Keywords = {Baernighausen}, + Publisher = {Oxford University Press}, + Title = {The Uses of Curiosity in Early Modern France and Germany}, + Year = {2004}} + +@mastersthesis{Loiacono2008, + Author = {Debora Loiacono}, + Keywords = {Baernighausen}, + Langid = {italian}, + Note = {Supervisor: Alberto Cottino, Bologna}, + School = {Bologna}, + Title = {Collezionismo e mercato artistico a Roma tra '800 e '900: La Galleria Sangiorgi. Tesi di laurea in metodologia della ricerca storico-artistica}, + Year = {2008}} + +@article{Loiacono2011, + Author = {Debora Loiacono}, + Journal = {Vallori Tattili}, + Keywords = {Baernighausen}, + Langid = {italian}, + Pages = {105–116}, + Title = {Gli arredi ‘in stile’ della Galleria Sangiorgi di Roma e qualche appunto su Umberto Giunti alias Falsario in Calcinaccio}, + Year = {2011}} + +@book{Bader2013, + Address = {München}, + Author = {Bader, L.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Keywords = {mm}, + Langid = {ngerman}, + Publisher = {Wilhelm Fink}, + Title = {Bild-Prozesse im 19.\ Jahrhundert: Der Holbein-Streit und die Ursprünge der Kunstgeschichte}, + Year = {2013}} + +@incollection{Beyrodt1975, + Address = {Gießen}, + Author = {Beyrodt, W.}, + Booktitle = {Kunstwissenschaft und Kunstvermittlung}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Editor = {I. Below}, + Keywords = {mm}, + Langid = {ngerman}, + Pages = {173–187}, + Title = {Diareihen für den Unterricht}, + Year = {1975}} + +@book{Caraffa2009, + Address = {München}, + Date-Modified = {2017-07-17 09:28:50 +0000}, + Editor = {Caraffa, C.}, + Keywords = {mm}, + Langid = {ngerman}, + Publisher = {Deutscher Kunstverlag}, + Title = {Fotografie als Instrument und Medium der Kunstgeschichte}, + Year = {2009}} + +@incollection{Dilly1975, + Author = {Dilly, H.}, + Booktitle = {Kunstwissenschaft und Kunstvermittlung}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Editor = {I. Below}, + Keywords = {mm}, + Langid = {ngerman}, + Pages = {153–172}, + Publisher = {Gießen}, + Title = {Lichtprojektion: Prothese der Kunstbetrachtung}, + Year = {1975}} + +@incollection{Dilly1995, + Addendum = {Rundbrief Fotografie; Sonderheft 2}, + Address = {Göppingen}, + Author = {Dilly, H.}, + Booktitle = {Zwischen Markt und Museum: Beiträge der Tagung Präsentationsformen von Fotografie am 24.\ und 25.\ Juni 1994 im Reiß-Museum der Stadt Mannheim}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Keywords = {mm}, + Publisher = {39–44}, + Title = {Bildwerfer: 121 Jahre wissenschaftliche Dia-Projektion}, + Year = {1995}} + +@incollection{Dilly2009, + Address = {München}, + Author = {Dilly, H.}, + Booktitle = {Fotografie als Instrument und Medium der Kunstgeschichte}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Editor = {C. Caraffa}, + Keywords = {mm}, + Pages = {91–116}, + Publisher = {Deutscher Kunstverlag}, + Title = {Weder Grimm noch Schmarsow, geschweige denn Wölfflin \dots\ Zur jüngsten Diskussion über die Diaprojektion um 1900}, + Year = {2009}} + +@article{Eisenhauer2006, + Author = {Eisenhauer, J.\ F.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Journal = {A Journal of Issues and Research}, + Keywords = {mm}, + Langid = {english}, + Number = {3}, + Pages = {198–214}, + Title = {Next Slide Please: Studies in Art Education}, + Volume = {47}, + Year = {2006}} + +@article{Fawcett1983, + Author = {Fawcett, T.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Journal = {Art History}, + Keywords = {mm}, + Langid = {english}, + Number = {4}, + Pages = {442–460}, + Title = {Visual Facts and the Nineteenth Century Art Lecture}, + Volume = {6}, + Year = {1983}} + +@incollection{Grimm1897, + Address = {Berlin}, + Author = {Grimm, H.}, + Booktitle = {Beiträge zur Deutschen Culturgeschichte}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Editor = {H. Grimm}, + Keywords = {mm}, + Langid = {ngerman}, + Pages = {XXX}, + Publisher = {W. Herts}, + Title = {Die Umgestaltung der Universitätsvorlesungen über Neuere Kunstgeschichte durch die Anwendung des Skioptikons}, + Year = {1897}} + +@incollection{Haffner2007, + Address = {Berlin}, + Author = {Haffner, D.}, + Booktitle = {Bild/Geschichte: Festschrift für Horst Bredekamp}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Editor = {P. Helas and M. Polte and C. Rückert and B. Uppemkamp}, + Keywords = {mm}, + Langid = {ngerman}, + Pages = {119–129}, + Publisher = {Akademie-Verlag}, + Title = {„Die Kunstgeschichte ist ein technisches Fach“. Bilder an der Wand, auf dem Schirm und im Netz}, + Year = {2007}} + +@book{Hess1999, + Address = {München}, + Author = {Heß, H.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Keywords = {mm}, + Langid = {ngerman}, + Publisher = {Akademie Verlag}, + Title = {Der Kunstverlag Franz Hanfstaengl und die frühe fotografische Kunstreproduktion: Das Kunstwerk und sein Abbild}, + Year = {1999}} + +@book{Hotz1965, + Author = {Hotz, J.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Keywords = {mm}, + Publisher = {Karlsruhe}, + Title = {Aktenauszüge zur Geschichte des Lehrstuhls und Instituts für Kunstgeschichte an der Technischen Hochschule Karlsruhe}, + Year = {1965}} + +@article{Lankheit1966, + Author = {Lankheit, K.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Journal = {Karlsruher Akademische Reden, Neue Folge}, + Keywords = {mm}, + Pages = {5–23}, + Title = {Kunstgeschichte unter dem Primat der Technik: Rektoratsrede gehalten bei der Jahresfeier am 4.\ Dezember 1965}, + Volume = {24}, + Year = {1966}} + +@article{Leighton1984, + Author = {Leighton, H. B.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Journal = {History of Photography}, + Keywords = {mm}, + Langid = {english}, + Number = {2}, + Pages = {107–118}, + Title = {The Lantern Slide and Art History}, + Volume = {8}, + Year = {1984}} + +@book{Malraux1987, + Address = {Frankfurt, New York}, + Author = {Malraux, A.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Keywords = {mm}, + Langid = {ngerman}, + Publisher = {Campus Verlag}, + Title = {Das imaginäre Museum}, + Year = {1987}} + +@book{Marcy1877, + Address = {Philadelphia}, + Author = {Marcy, L.\ J.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Keywords = {mm}, + Langid = {english}, + Publisher = {James A.\ Moore}, + Title = {The Sciopticon Manual, Explaining Lantern Projections in General, and the Sciopticon Apparatus in Particular: Including Magic Lantern Attachments, Experiments, Novelties, Colored and Photo-transparencies, Mechanical Movements, Etc.}, + Year = {1877}} + +@article{Matyssek2005, + Author = {Matyssek, A.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Journal = {Berichte zur Wissenschaftsgeschichte}, + Keywords = {mm}, + Number = {3}, + Pages = {227–235}, + Title = {„Entdecker`` und „Finder``: Über die fotografische Wissensproduktion der Kunstgeschichte}, + Volume = {28}, + Year = {2005}} + +@book{McLuhan2015, + Addendum = {Critical Edition edited by Terrence Gordon}, + Address = {Berkeley}, + Author = {McLuhan, M.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Keywords = {mm}, + Langid = {english}, + Publisher = {Gingko Press}, + Title = {Understanding Media: The Extensions of Man}, + Year = {2015 [1964]}} + +@article{Meyer1879, + Author = {Meyer, B.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Journal = {Westermanns illustrierte deutsche Monatshefte: Ein Familienbuch für das gesamte geistige Leben der Gegenwart}, + Keywords = {mm}, + Pages = {196–209}, + Title = {Die Photographie im Dienste der Kunstwissenschaft und des Kunstunterrichts}, + Volume = {47}, + Year = {1879}} + +@book{Meyer1883, + Address = {Karlsruhe}, + Author = {Meyer, B.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Keywords = {mm}, + Publisher = {Selbstverl.}, + Title = {Glasphotogramme für den kunstwissenschaftlichen Unterricht}, + Year = {1883}} + +@article{Nelson2000, + Author = {Nelson, R.\ S.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Journal = {Critical Inquiry}, + Keywords = {mm}, + Langid = {english}, + Number = {3}, + Pages = {414–434}, + Title = {The Slide Lecture, or the Work of Art “History” in the Age of Mechanical Reproduction}, + Volume = {26}, + Year = {2000}} + +@incollection{Papenbrock2006, + Address = {Karlsruhe}, + Author = {Papenbrock, M.}, + Booktitle = {Kunst und Architektur in Karlsruhe: Festschrift für Norbert Schneider}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Editor = {K. Büttner and M. Papenbrock}, + Keywords = {mm}, + Pages = {179–191}, + Publisher = {Universitätsverlag Karlsruhe}, + Title = {Der Lehrstuhl für Kunstgeschichte in Karlsruhe: Ein Rückblick}, + Year = {2006}} + +@article{Reichle2002, + Author = {Reichle, I.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Journal = {kritische berichte. Zeitschrift für Kunst- und Kulturwissenschaften}, + Keywords = {mm}, + Pages = {40–56}, + Title = {Medienbrüche}, + Url = {http://www.kunstgeschichte.de/kgs/publikationen/mb1.html}, + Volume = {Heft 1}, + Year = {2002}, + Bdsk-Url-1 = {http://www.kunstgeschichte.de/kgs/publikationen/mb1.html}} + +@incollection{Reichle2005, + Address = {Hamburg}, + Author = {Reichle, I.}, + Booktitle = {Sichtbarkeit und Medium: Austausch, Verknüpfung und Differenz naturwissenschaftlicher und ästhetischer Bildstrategien}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Editor = {A. Zimmermann}, + Keywords = {mm}, + Pages = {169–181}, + Publisher = {Hamburg University Press}, + Title = {Fotografie und Lichtbild: ,Die unsichtbaren’ Bildmedien der Kunstgeschichte}, + Year = {2005}} + +@incollection{Roessler2010, + Address = {Berlin}, + Author = {Rößler, J.}, + Booktitle = {In der Mitte Berlins: 200 Jahre Kunstgeschichte an der Humboldt-Universität}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Editor = {In H. Bredekamp and A.\ S. Labuda}, + Keywords = {mm}, + Pages = {69–90}, + Publisher = {Gebr.\ Mann Verlag}, + Title = {Erlebnisbegriff und Skioptikon: Herman Grimm und die Geisteswissenschaften an der Berliner Universität}, + Year = {2010}} + +@incollection{Ruchatz2000, + Address = {Wiltshire}, + Author = {Ruchatz, J.}, + Booktitle = {Visual Delights: Essays on the Popular and Projected Image in the 19th Century}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Editor = {S. Popple and V. Toulmin}, + Keywords = {mm}, + Pages = {38–49}, + Publisher = {Flicks Books}, + Title = {The Magic Lantern in Connection with Pohotography: Rationalisation and Technology}, + Year = {2000}} + +@book{Ruchatz2003, + Address = {München}, + Author = {Ruchatz, J.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Keywords = {mm}, + Publisher = {Fink}, + Title = {Licht und Wahrheit: Eine Mediumgeschichte der fotografischen Projektion}, + Year = {2003}} + +@book{Thuerlemann2013, + Address = {München}, + Author = {Thürlemann, F.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Keywords = {mm}, + Publisher = {Fink}, + Title = {Mehr als ein Bild: Für eine Kunstgeschichte des hyperimage}, + Year = {2013}} + +@book{Ullrich2009, + Address = {Berlin}, + Author = {Ullrich, W.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Keywords = {mm}, + Publisher = {Wagenbach}, + Title = {Raffinierte Kunst: Übung vor Reproduktionen}, + Year = {2009}} + +@incollection{Wenk1999, + Address = {München}, + Author = {Wenk, S.}, + Booktitle = {Konfigurationen: Zwischen Kunst und Medien}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Editor = {S. Schade}, + Keywords = {mm}, + Pages = {293–305}, + Publisher = {Fink}, + Title = {Zeigen und Schweigen: Der kunsthistorische Diskurs und die Diaprojektion}, + Year = {1999}} + +@book{Wyss1996, + Address = {Köln}, + Author = {Wyss, B.}, + Date-Modified = {2017-07-17 09:28:59 +0000}, + Keywords = {mm}, + Publisher = {Dumont}, + Title = {Der Wille zur Kunst: Zur ästhetischen Mentalität der Moderne}, + Year = {1996}}