citeproc-py-0.3.0/0000755000076500000240000000000012427163401014517 5ustar brechtmstaff00000000000000citeproc-py-0.3.0/bin/0000755000076500000240000000000012427163401015267 5ustar brechtmstaff00000000000000citeproc-py-0.3.0/bin/csl_unsorted0000755000076500000240000000626012375162470017734 0ustar brechtmstaff00000000000000#!/usr/bin/env python from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * import os import sys import warnings from optparse import OptionParser # The references are parsed from a BibTeX database, so we import the # corresponding parser. from citeproc.source.bibtex import BibTeX # Import the citeproc-py classes we'll use below. from citeproc import frontend from citeproc import CitationStylesStyle, CitationStylesBibliography from citeproc import formatter from citeproc import Citation, CitationItem def main(): usage = \ """usage: %prog [options] ' Output a formatted bibliography from bibtex file to stdout You might want to put the path to your CSL styles in the `CSL_STYLES_PATH` environment variable with something like (bash shell):: export CSL_STYLES_PATH=$HOME/dev_trees/styles """ parser = OptionParser(usage) parser.add_option('-s', '--style', dest='style', default='harvard1', help='style file', metavar='STYLE_FILE') parser.add_option('-f', '--format', dest='format', default='rst', help='output type', metavar='FORMAT') (options, args) = parser.parse_args() if len(args) != 1: parser.print_usage() sys.exit(1) output_format = options.format try: output_format = getattr(formatter, options.format) except AttributeError: available_formatters = (attr for attr in dir(formatter) if not attr.startswith('__')) print('style should be one of: ' + ', '.join(available_formatters)) sys.exit(1) # Get styles path out of the environment variable env_path = os.environ.get('CSL_STYLES_PATH') if env_path is not None: frontend.STYLES_PATH = env_path # Silence lots of warnings warnings.simplefilter('ignore') # Read bibliography bib_source = BibTeX(args[0]) # load a CSL style (full path or name of style in style path) bib_style = CitationStylesStyle(options.style) # Create the citeproc-py bibliography, passing it the: # * CitationStylesStyle, # * BibliographySource (BibTeX in this case), and # * a formatter (plain, html, or rst) bibliography = CitationStylesBibliography(bib_style, bib_source, output_format) # Processing citations in a document need to be done in two passes as for # some CSL styles, a citation can depend on the order of citations in the # bibliography and thus on citations following the current one. # For this reason, we first need to register all citations with the # CitationStylesBibliography. # Just read every one in key order for name in sorted(bib_source): bibliography.register(Citation([CitationItem(name)])) # In the second pass, CitationStylesBibliography can generate citations. # CitationStylesBibliography.cite() requires a callback function to be # passed along to be called in case a CitationItem's key is not present in # the bibliography. for item in bibliography.bibliography(): print(str(item)) if __name__ == '__main__': main() citeproc-py-0.3.0/citeproc/0000755000076500000240000000000012427163401016327 5ustar brechtmstaff00000000000000citeproc-py-0.3.0/citeproc/__init__.py0000644000076500000240000000364312377730351020456 0ustar brechtmstaff00000000000000 from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * import os from glob import glob from warnings import warn from . import types, formatter DATA_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data') SCHEMA_PATH = os.path.join(DATA_PATH, 'schema', 'csl.rng') LOCALES_PATH = os.path.join(DATA_PATH, 'locales') STYLES_PATH = os.path.join(DATA_PATH, 'styles') NAMES = ['author', 'collection_editor', 'composer', 'container_author', 'editor', 'editorial_director', 'illustrator', 'interviewer', 'original_author', 'recipient', 'translator'] DATES = ['accessed', 'container', 'event_date', 'issued', 'original_date', 'submitted'] NUMBERS = ['chapter_number', 'collection_number', 'edition', 'issue', 'number', 'number_of_pages', 'number_of_volumes', 'volume'] VARIABLES = (['abstract', 'annote', 'archive', 'archive_location', 'archive_place', 'authority', 'call_number', 'citation_label', 'citation_number', 'collection_title', 'container_title', 'container_title_short', 'dimensions', 'DOI', 'event', 'event_place', 'first_reference_note_number', 'genre', 'ISBN', 'ISSN', 'jurisdiction', 'keyword', 'language', 'locator', 'medium', 'note', 'original_publisher', 'original_publisher_place', 'original_title', 'page', 'page_first', 'PMCID', 'PMID', 'publisher', 'publisher_place', 'references', 'section', 'source', 'status', 'title', 'title_short', 'URL', 'version', 'year_suffix'] + NAMES + DATES + NUMBERS) LOCALES = [os.path.basename(path)[8:-4] for path in glob(os.path.join(LOCALES_PATH, 'locales-*.xml'))] from .frontend import CitationStylesStyle, CitationStylesBibliography from .source import Citation, CitationItem, Locator citeproc-py-0.3.0/citeproc/data/0000755000076500000240000000000012427163401017240 5ustar brechtmstaff00000000000000citeproc-py-0.3.0/citeproc/data/locales/0000755000076500000240000000000012427163401020662 5ustar brechtmstaff00000000000000citeproc-py-0.3.0/citeproc/data/locales/locales-af-ZA.xml0000644000076500000240000002373612375162470023744 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 toegang verkry en and others anonymous anon at available at by circa c. cited edition editions ed et al. voorhande van ibid. in in press internet interview letter no date n.d. online presented at the reference references ref. refs. opgehaal scale version AD BC th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth book books chapter chapters column columns figure figures folio folios number numbers reël reëls note notes opus opera bladsy bladsye paragraaf paragrawe part parts section sections sub verbo sub verbis verse verses volume volumes bk chap col fig f no l. n. op bl bll para pt sec s.v. s.vv. v vv vol vols ¶¶ § §§ director directors redakteur redakteurs editor editors illustrator illustrators vertaler vertalers editor & translator editors & translators dir. dirs. red reds ed. eds. ill. ills. vert verts ed. & tran. eds. & trans. directed by onder redaksie van edited by illustrated by interview by to by vertaal deur edited & translated by by dir. red ed. illus. verts ed. & trans. by Januarie Februarie Maart April Mei Junie Julie Augustus September Oktober November Desember Jan Feb Mrt Apr Mei Jun Jul Aug Sep Okt Nov Des Spring Summer Autumn Winter citeproc-py-0.3.0/citeproc/data/locales/locales-ar-AR.xml0000644000076500000240000002512112375162470023736 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 تاريخ الوصول و وآخرون مجهول مجهول عند available at عن طريق حوالي حو. وثق الطبعة الطبعات ط. وآخ. التالي من المرجع السابق في قيد النشر انترنت مقابلة خطاب دون تاريخ د.ت على الخط المباشر قُدَّم في مرجع مراجع مرجع مراجع استرجع في scale version ب.م. ق.م. " " ' ' الاول الثاني الثالث الرابع الخامس السادس السابع الثامن التاسع العاشر كتاب كتب فصل فصول عمود أعمدة رسم توضيحي رسوم توضيحية ورقة أوراق عدد أعداد سطر أسطر ملاحظة ملاحظات نوته موسيقية نوت موسيقية صفحة صفحات فقرة فقرات جزء أجزاء قسم أقسام تفسير فرعي تفسيرات فرعية بيت شعر أبيات شعر مجلد مجلدات كتاب فصل عمود رسم توضيحي مطوية عدد l. n. نوتة موسيقية ص ص.ص. فقرة ج. قسم تفسير فرعي تفسيرات فرعية بيت شعر أبيات شعر مج. مج. ¶¶ § §§ director directors محرر محررين رئيس التحرير رؤساء التحرير illustrator illustrators مترجم مترجمين مترجم ومحرر مترجمين ومحررين dir. dirs. محرر محررين مشرف على الطبعة مشرفين على الطبعة ill. ills. مترجم مترجمين مترجم ومشرف على الطباعه مترجمين ومشرفين على الطباعه directed by تحرير اعداد illustrated by مقابلة بواسطة مرسل الى by ترجمة اعداد وترجمة dir. تحرير اشرف على الطبعة illus. ترجمة ترجمه واشرف على الطباعه يناير فبراير مارس ابريل مايو يونيو يوليو اغسطس سبتمبر اكتوبر نوفمبر ديسمبر يناير فبراير مارس ابريل مايو يونيو يوليو اغسطس سبتمبر اكتوبر نوفمبر ديسمبر الربيع الصيف الخريف الشتاء citeproc-py-0.3.0/citeproc/data/locales/locales-bg-BG.xml0000644000076500000240000002475712375162470023730 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 отворен на и и други анонимен анон в available at by circa c. цитиран издание издания изд и съавт. предстоящ от пак там в под печат интернет интервю писмо no date без дата онлайн представен на reference references ref. refs. изтеглен на scale version AD BC th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth книга книги глава глави колона колони фигура фигури фолио фолия брой броеве ред редове бележка бележки опус опуси страница страници параграф параграфи част части раздел раздели sub verbo sub verbis стих стихове том томове кн гл кол фиг фол бр l. n. оп с с-ци п ч разд s.v. s.vv. ст ст-ове том т-ове ¶¶ § §§ director directors редактор редактори editor editors illustrator illustrators преводач преводачи editor & translator editors & translators dir. dirs. ред ред-ри ed. eds. ill. ills. прев прев-чи ed. & tran. eds. & trans. directed by редактиран от edited by illustrated by интервюиран от до by преведен от edited & translated by by dir. ред ed. illus. прев ed. & trans. by Януари Февруари Март Април Май Юни Юли Август Септември Октомври Ноември Декември Яну Фев Мар Апр Май Юни Юли Авг Сеп Окт Ное Дек Spring Summer Autumn Winter citeproc-py-0.3.0/citeproc/data/locales/locales-ca-AD.xml0000644000076500000240000002334312375162470023705 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 accedit i i altres anònim anòn. a disponible a per circa c. citat edició edicions ed. et al. previst de ibíd. en en impremta internet entrevista carta sense data s.d. en línia presentat a referència referències ref. ref. recuperat escala versió dC aC « » - a primera segona tercera quarta cinquena sisena setena vuitena novena desena llibre llibres capítol capítols columna columnes figura figures foli folis número números línia línies nota notes opus opera pàgina pàgines paràgraf paràgrafs part parts secció seccions sub voce sub vocibus vers versos volum volums llib. cap. col. fig. f. núm. l. n. op. p. p. par. pt. sec. s.v. s.v. v. v. vol. vol. § § § § director directors editor editors editor editors il·lustrador il·lustradors traductor traductors editor i traductor editors i traductors dir. dir. ed. ed. ed. ed. il·lust. il·lust. trad. trad. ed. i trad. ed. i trad. dirigit per editat per editat per il·lustrat per entrevistat per a per traduït per editat i traduït per per dir. ed. ed. il·lust. trad. ed. i trad. per gener febrer març abril maig juny juliol agost setembre octubre novembre desembre gen. feb. març abr. maig juny jul. ago. set. oct. nov. des. primavera estiu tardor hivern citeproc-py-0.3.0/citeproc/data/locales/locales-cs-CZ.xml0000644000076500000240000002355312375162470023762 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 viděno vid. a a další anonym anon. v dostupné z od asi cca. citován vydání vydání vyd. et al. nadcházející z ibid. in v tisku internet interview dopis nedatováno b.r. online prezentováno v reference reference ref. ref. dostupné měřítko verze n. l. př. n. l. " ´ . první druhé třetí čtvrté páté šesté sedmé osmé deváté desáté kniha knihy kapitola kapitoly sloupec sloupce obrázek obrázky list listy číslo čísla řádek řádky poznámka poznámky opus opusy strana strany odstavec odstavce část části sekce sekce pod heslem pod hesly verš verše ročník ročníky k. kap. sl. obr. l. č. ř. pozn. op. s. s. odst. č. sek. s.v. s.v. v. v. roč. roč. ¶¶ § §§ ředitel ředitelé editor editoři vedoucí editor vedoucí editoři ilustrátor ilustrátoři překladatel překladatelé editor a překladatel editoři a překladatelé řed. řed. ed. ed. ed. ed. il. il. přel. přel. ed. a přel. ed. a přel. řídil editoval editoval ilustroval rozhovor vedl pro recenzoval přeložil editoval a přeložil řed. ed. ed. ilust. přel. ed. a přel. leden únor březen duben květen červen červenec srpen září říjen listopad prosinec led. úno. bře. dub. kvě. čer. čvc. srp. zář. říj. lis. pro. jaro léto podzim zima citeproc-py-0.3.0/citeproc/data/locales/locales-da-DK.xml0000644000076500000240000002345112375162470023720 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 åbnet og med flere anonym anon. available at af cirka ca. citeret udgave udgaver udg. et al. kommende fra ibid. i i tryk internet interview brev ingen dato udateret online præsenteret ved reference referencer ref. refr. hentet scale version e.Kr f.Kr « » . første anden tredje fjerde femte sjette syvende ottende niende tiende bog bøger kapitel kapitler kolonne kolonner figur figurer folio folier nummer numre linje linjer note noter opus opuser side sider afsnit afsnit del dele sektion sektionerne sub verbo sub verbis vers vers bind bind b. kap. kol. fig. fol. nr. l. n. op. s. s. afs. d. sekt. s.v. s.vv. v. v. bd. bd. ¶¶ § §§ director directors redaktør redaktører redaktør redaktører illustrator illustrators oversætter oversættere redaktør & oversætter redaktører & oversættere dir. dirs. red. red. red. red. ill. ills. overs. overs. red. & overs. red. & overs. directed by redigeret af redigeret af illustrated by interviewet af modtaget af by oversat af redigeret & oversat af af dir. red. red. illus. overs. red. & overs. af Januar Februar Marts April Maj Juni Juli August September Oktober November December Jan. Feb. Mar. Apr. Maj Jun. Jul. Aug. Sep. Okt. Nov. Dec. Forår Sommer Efterår vinter citeproc-py-0.3.0/citeproc/data/locales/locales-de-AT.xml0000644000076500000240000002353412375162470023734 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 zugegriffen und und andere ohne Autor o. A. auf available at von circa ca. zitiert Auflage Auflagen Aufl. u. a. i. E. von ebd. in im Druck Internet Interview Brief ohne Datum o. J. online gehalten auf der Referenz Referenzen Ref. Ref. abgerufen scale version n. Chr. v. Chr. . erster zweiter dritter vierter fünfter sechster siebter achter neunter zehnter Buch Bücher Kapitel Kapitel Spalte Spalten Abbildung Abbildungen Blatt Blätter Nummer Nummern Zeile Zeilen Note Noten Opus Opera Seite Seiten Absatz Absätze Teil Teile Abschnitt Abschnitte sub verbo sub verbis Vers Verse Band Bände B. Kap. Sp. Abb. Fol. Nr. l. n. op. S. S. Abs. Teil Abschn. s.v. s.vv. V. V. Bd. Bd. ¶¶ § §§ director directors Herausgeber Herausgeber Herausgeber Herausgeber illustrator illustrators Übersetzer Übersetzer Herausgeber & Übersetzer Herausgeber & Übersetzer dir. dirs. Hrsg. Hrsg. Hrsg. Hrsg. ill. ills. Übers. Übers. Hrsg. & Übers. Hrsg. & Übers directed by herausgegeben von herausgegeben von illustrated by interviewt von an by übersetzt von herausgegeben und übersetzt von von dir. hg. von hg. von illus. übers. von hg. & übers. von Januar Februar März April Mai Juni Juli August September Oktober November Dezember Jan. Feb. März Apr. Mai Juni Juli Aug. Sep. Okt. Nov. Dez. Frühjahr Sommer Herbst Winter citeproc-py-0.3.0/citeproc/data/locales/locales-de-CH.xml0000644000076500000240000002353412375162470023722 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 zugegriffen und und andere ohne Autor o. A. auf available at von circa ca. zitiert Auflage Auflagen Aufl. u. a. i. E. von ebd. in im Druck Internet Interview Brief ohne Datum o. J. online gehalten auf der Referenz Referenzen Ref. Ref. abgerufen scale version n. Chr. v. Chr. . erster zweiter dritter vierter fünfter sechster siebter achter neunter zehnter Buch Bücher Kapitel Kapitel Spalte Spalten Abbildung Abbildungen Blatt Blätter Nummer Nummern Zeile Zeilen Note Noten Opus Opera Seite Seiten Absatz Absätze Teil Teile Abschnitt Abschnitte sub verbo sub verbis Vers Verse Band Bände B. Kap. Sp. Abb. Fol. Nr. l. n. op. S. S. Abs. Teil Abschn. s.v. s.vv. V. V. Bd. Bd. ¶¶ § §§ director directors Herausgeber Herausgeber Herausgeber Herausgeber illustrator illustrators Übersetzer Übersetzer Herausgeber & Übersetzer Herausgeber & Übersetzer dir. dirs. Hrsg. Hrsg. Hrsg. Hrsg. ill. ills. Übers. Übers. Hrsg. & Übers. Hrsg. & Übers directed by herausgegeben von herausgegeben von illustrated by interviewt von an by übersetzt von herausgegeben und übersetzt von von dir. hg. von hg. von illus. übers. von hg. & übers. von Januar Februar März April Mai Juni Juli August September Oktober November Dezember Jan. Feb. März Apr. Mai Juni Juli Aug. Sep. Okt. Nov. Dez. Frühjahr Sommer Herbst Winter citeproc-py-0.3.0/citeproc/data/locales/locales-de-DE.xml0000644000076500000240000002355312375162470023721 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 zugegriffen und und andere ohne Autor o. A. auf verfügbar unter von circa ca. zitiert Auflage Auflagen Aufl. u. a. i. E. von ebd. in im Druck Internet Interview Brief ohne Datum o. J. online gehalten auf der Referenz Referenzen Ref. Ref. abgerufen Maßstab Version n. Chr. v. Chr. . erster zweiter dritter vierter fünfter sechster siebter achter neunter zehnter Buch Bücher Kapitel Kapitel Spalte Spalten Abbildung Abbildungen Blatt Blätter Nummer Nummern Zeile Zeilen Note Noten Opus Opera Seite Seiten Absatz Absätze Teil Teile Abschnitt Abschnitte sub verbo sub verbis Vers Verse Band Bände B. Kap. Sp. Abb. Fol. Nr. l. n. op. S. S. Abs. Teil Abschn. s.v. s.vv. V. V. Bd. Bd. ¶¶ § §§ Regisseur Regisseure Herausgeber Herausgeber Herausgeber Herausgeber Illustrator illustratoren Übersetzer Übersetzer Herausgeber & Übersetzer Herausgeber & Übersetzer Reg. Reg.. Hrsg. Hrsg. Hrsg. Hrsg. Ill. Ill. Übers. Übers. Hrsg. & Übers. Hrsg. & Übers directed by herausgegeben von herausgegeben von illustriert von interviewt von an von übersetzt von herausgegeben und übersetzt von von Reg. hg. von hg. von illus. von übers. von hg. & übers. von Januar Februar März April Mai Juni Juli August September Oktober November Dezember Jan. Feb. März Apr. Mai Juni Juli Aug. Sep. Okt. Nov. Dez. Frühjahr Sommer Herbst Winter citeproc-py-0.3.0/citeproc/data/locales/locales-el-GR.xml0000644000076500000240000002601712375162470023747 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 ημερομηνία πρόσβασης και και άλλοι ανώνυμο ανών. εφ. available at από περίπου περ. παρατίθεται έκδοση εκδόσεις έκδ. κ.ά. προσεχές από στο ίδιο στο υπό έκδοση διαδίκτυο συνέντευξη επιστολή χωρίς χρονολογία χ.χ. έκδοση σε ψηφιακή μορφή παρουσιάστηκε στο παραπομπή παραπομπές παρ. παρ. ανακτήθηκε scale version μ.Χ. π.Χ. ' ' ος πρώτος δεύτερος τρίτος τέταρτος πέμπτος έκτος έβδομος όγδοος ένατος δέκατος βιβλίο βιβλίο κεφάλαιο κεφάλαια στήλη στήλες εικόνα εικόνες φάκελος φάκελοι τεύχος τεύχη σειρά σειρές σημείωση σημειώσεις έργο έργα σελίδα σελίδες παράγραφος παράγραφοι μέρος μέρη τμήμα τμήματα λήμμα λήμματα στίχος στίχοι τόμος τόμοι βιβ. κεφ. στ. εικ. φάκ τχ. l. n. έργ. σ σσ παρ. μέρ. τμ. λήμ. λήμ. στ. στ. τ. τ. ¶¶ § §§ director directors επιμελητής επιμελητές διευθυντής σειράς διευθυντές σειράς illustrator illustrators μεταφραστής μεταφραστές μεταφραστής και επιμελητής μεταφραστές και επιμελητές dir. dirs. επιμ. επιμ. δ/ντής σειράς δ/ντές σειρας ill. ills. μτφ. μτφ. μτφ. και επιμ. μτφ. και επιμ. directed by επιμέλεια διεύθυνση σειράς illustrated by συνέντευξη παραλήπτης by μετάφραση μετάφραση και επιμέλεια στον συλλ. τόμο dir. επιμέλ. δ/νση σειράς illus. μετάφρ. μετάφρ. και επιμέλ. Ιανουάριος Φεβρουάριος Μάρτιος Απρίλιος Μάιος Ιούνιος Ιούλιος Αύγουστος Σεπτέμβριος Οκτώβριος Νοέμβριος Δεκέμβριος Ιανουαρίου Φεβρουαρίου Μαρτίου Απριλίου Μαΐου Ιουνίου Ιουλίου Αυγούστου Σεπτεμβρίου Οκτωβρίου Νοεμβρίου Δεκεμβρίου Άνοιξη Καλοκαίρι Φθινόπωρο Χειμώνας citeproc-py-0.3.0/citeproc/data/locales/locales-en-GB.xml0000644000076500000240000002372712375162470023736 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 accessed and and others anonymous anon. at available at by circa c. cited edition editions ed. et al. forthcoming from ibid. in in press internet interview letter no date n.d. online presented at the reference references ref. refs. retrieved scale version AD BC th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth book books chapter chapters column columns figure figures folio folios number numbers line lines note notes opus opera page pages paragraph paragraph part parts section sections sub verbo sub verbis verse verses volume volumes bk. chap. col. fig. f. no. l. n. op. p. pp. para. pt. sec. s.v. s.vv. v. vv. vol. vols. ¶¶ § §§ director directors editor editors editor editors illustrator illustrators translator translators editor & translator editors & translators dir. dirs. ed. eds. ed. eds. ill. ills. tran. trans. ed. & tran. eds. & trans. directed by edited by edited by illustrated by interview by to by translated by edited & translated by by dir. by ed. by ed. by illus. by trans. by ed. & trans. by January February March April May June July August September October November December Jan. Feb. Mar. Apr. May Jun. Jul. Aug. Sep. Oct. Nov. Dec. Spring Summer Autumn Winter citeproc-py-0.3.0/citeproc/data/locales/locales-en-US.xml0000644000076500000240000002372712375162470023775 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 accessed and and others anonymous anon. at available at by circa c. cited edition editions ed. et al. forthcoming from ibid. in in press internet interview letter no date n.d. online presented at the reference references ref. refs. retrieved scale version AD BC th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth book books chapter chapters column columns figure figures folio folios number numbers line lines note notes opus opera page pages paragraph paragraph part parts section sections sub verbo sub verbis verse verses volume volumes bk. chap. col. fig. f. no. l. n. op. p. pp. para. pt. sec. s.v. s.vv. v. vv. vol. vols. ¶¶ § §§ director directors editor editors editor editors illustrator illustrators translator translators editor & translator editors & translators dir. dirs. ed. eds. ed. eds. ill. ills. tran. trans. ed. & tran. eds. & trans. directed by edited by edited by illustrated by interview by to by translated by edited & translated by by dir. by ed. by ed. by illus. by trans. by ed. & trans. by January February March April May June July August September October November December Jan. Feb. Mar. Apr. May Jun. Jul. Aug. Sep. Oct. Nov. Dec. Spring Summer Autumn Winter citeproc-py-0.3.0/citeproc/data/locales/locales-es-ES.xml0000644000076500000240000002346712375162470023763 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 accedido y y otros anónimo anón. en disponible en de circa c. citado edición ediciones ed. et al. previsto a partir de ibid. en en imprenta internet entrevista carta sin fecha s. f. en línea presentado en referencia referencias ref. refs. recuperado escala versión d. C. a. C. « » - primera segunda tercera cuarta quinta sexta séptima octava novena décima libro libros capítulo capítulos columna columnas figura figuras folio folios número números línea líneas nota notas opus opera página páginas párrafo párrafos parte partes sección secciones sub voce sub vocibus verso versos volumen volúmenes lib. cap. col. fig. f. n.º l. n. op. p. pp. párr. pt. sec. s. v. s. vv. v. vv. vol. vols. § § § § director directores editor editores editor editores ilustrador ilustradores traductor traductores editor y traductor editores y traductores dir. dirs. ed. eds. ed. eds. ilust. ilusts. trad. trads. ed. y trad. eds. y trads. dirigido por editado por editado por ilustrado por entrevistado por a por traducido por editado y traducido por de dir. ed. ed. ilust. trad. ed. y trad. enero febrero marzo abril mayo junio julio agosto septiembre octubre noviembre diciembre ene. feb. mar. abr. may jun. jul. ago. sep. oct. nov. dic. primavera verano otoño invierno citeproc-py-0.3.0/citeproc/data/locales/locales-et-EE.xml0000644000076500000240000002327712375162470023745 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 vaadatud ja ja teised anonüümne anon available at umbes u tsiteeritud väljaanne väljaanded tr et al. ilmumisel ibid. trükis internet intervjuu kiri s.a. s.a. online esitatud viide viited viide viited salvestatud scale version pKr eKr esimene teine kolmas neljas viies kuues seitsmes kaheksas üheksas kümnes raamat raamatud peatükk peatükid veerg veerud joonis joonised foolio fooliod number numbrid rida read viide viited opus opera lehekülg leheküljed lõik lõigud osa osad alajaotis alajaotised sub verbo sub verbis värss värsid köide köited rmt ptk v joon f nr l. n. op lk lk lõik osa alajaot. s.v. s.vv. v vv kd kd ¶¶ § §§ director directors toimetaja toimetajad toimetaja toimetajad illustrator illustrators tõlkija tõlkijad toimetaja & tõlkija toimetajad & tõlkijad dir. dirs. toim toim toim toim ill. ills. tõlk tõlk toim & tõlk toim & tõlk directed by toimetanud toimetanud illustrated by intervjueerinud by tõlkinud toimetanud & tõlkinud dir. toim toim illus. tõlk toim & tõlk jaanuar veebruar märts aprill mai juuni juuli august september oktoober november detsember jaan veebr märts apr mai juuni juuli aug sept okt nov dets kevad suvi sügis talv citeproc-py-0.3.0/citeproc/data/locales/locales-eu.xml0000644000076500000240000002374512375162470023457 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 eskuratua eta eta beste ezezaguna ezez. -(e)n available at -(e)k egina inguru ing. aipatua argitalpena argitalpenak arg. et al. bidean -(e)tik ibíd. in moldiztegian internet elkarrizketa gutuna datarik gabe d. g. sarean -(e)n aurkeztua aipamena aipamenak aip. aip. berreskuratua scale version K.a. K.o. « » . lehengo bigarren hirugarren laugarren bosgarren seigarren zazpigarren zortzigarren bederatzigarren hamargarren liburua liburuak kapitulua kapituluak zutabea zutabeak irudia irudiak orria orriak zenbakia zenbakiak lerroa lerroak oharra oharrak obra obrak orrialdea orrialdeak paragrafoa paragrafoak zatia zatiak atala atalak sub voce sub vocem bertsoa bertsoak luburikia luburukiak lib. kap. zut. iru. or. zenb. l. n. op. or. or. par. zt. atal. s.v. s.v. b. bb. libk. libk. ¶¶ § § director directors argitaratzailea argitaratzaileak argitaratzailea argitaratzaileak illustrator illustrators itzultzailea itzultzaileak argitaratzaile eta itzultzailea argitaratzaile eta itzultzaileak dir. dirs. arg. arg. arg. arg. ill. ills. itzul. itzul. arg. eta itzul. arg. eta itzul. directed by -(e)k argitaratua -(e)k argitaratua illustrated by -(e)k elkarrizketatua -(r)entzat by -(e)k itzulia -(e)k argitaratu eta itzulia dir. arg. arg. illus. itzul. -(e)k arg. eta itzul. urtarrilak otsailak martxoak apirilak maiatzak ekainak uztailak abuztuak irailak urriak azaroak abenduak urt. ots. martx. apr. mai. eka. uzt. abz. ira. urr. aza. abe. udaberria uda udazkena negua citeproc-py-0.3.0/citeproc/data/locales/locales-fa-IR.xml0000644000076500000240000002536212375162470023741 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 دسترسی و و دیگران ناشناس ناشناس در available at توسط circa c. یادکرد ویرایش ویرایش‌های ویرایش و دیگران forthcoming از همان در زیر چاپ اینترنت مصاحبه نامه بدون تاریخ بدون تاریخ برخط ارائه شده در مرجع مراجع مرجع مراجع retrieved scale version AD BC th st nd rd th th th اول دوم سوم چهارم پنجم ششم هفتم هشتم نهم دهم کتاب کتاب‌های فصل فصل‌های ستون ستون‌های تصویر تصاویر برگ برگ‌های شماره شماره‌های خط خطوط یادداشت یادداشت‌های قطعه قطعات صفحه صفحات پاراگراف پاراگراف‌های بخش بخش‌های قسمت قسمت‌های sub verbo sub verbis بیت بیت‌های جلد جلدهای کتاب فصل ستون تصویر برگ ش l. n. قطعه ص صص پاراگراف بخش قسمت s.v s.vv بیت ابیات ج جج ¶¶ § §§ director directors ویرایشگر ویرایشگران ویرایشگر ویرایشگران illustrator illustrators مترجم مترجمین ویرایشگر و مترجم ویرایشگران و مترجمین dir. dirs. ویرایشگر ویرایشگران ویرایشگر ویرایشگران ill. ills. مترجم مترجمین ویرایشگر و مترجم ویرایشگران و مترجمین directed by edited by ویراسته‌ی illustrated by مصاحبه توسط به by ترجمه‌ی ترجمه و ویراسته‌ی توسط dir. ویراسته‌ی ویراسته‌ی illus. ترجمه‌ی ترجمه و ویراسته‌ی ژانویه فوریه مارس آوریل می ژوئن جولای آگوست سپتامبر اکتبر نوامبر دسامبر ژانویه فوریه مارس آوریل می ژوئن جولای آگوست سپتامبر اکتبر نوامبر دسامبر بهار تابستان پاییز زمستان citeproc-py-0.3.0/citeproc/data/locales/locales-fi-FI.xml0000644000076500000240000002347212375162470023735 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 viitattu ja ym. tuntematon tuntematon osoitteessa available at tekijä noin n. viitattu painos painokset p. ym. tulossa alkaen mt. teoksessa painossa internet haastattelu kirje ei päivämäärää n.d. verkossa esitetty tilaisuudessa viittaus viittaukset viit.. viit. noudettu scale version eaa. jaa. . ensimmäinen toinen kolmas neljäs viides kuudes seitsemäs kahdeksas yhdeksäs kymmenes kirja kirjat luku luvut palsta palstat kuvio kuviot folio foliot numero numerot rivi rivit muistiinpano muistiinpanot opus opukset sivu sivut kappale kappaleet osa osat osa osat sub verbo sub verbis säkeistö säkeistöt vuosikerta vuosikerrat kirja luku palsta kuv. fol. nro l. n. op. s. ss. kappale osa osa s.v. s.vv. säk. säk. vol. vol. ¶¶ § §§ director directors toimittaja toimittajat toimittaja toimittajat illustrator illustrators suomentaja suomentajat toimittaja ja suomentaja toimittajat ja suomentajat dir. dirs. toim. toim. toim. toim. ill. ills. suom. suom. toim. ja suom. toim. ja suom. directed by toimittanut toimittanut illustrated by haastatellut vastaanottaja by suomentanut toimittanut ja suomentanut dir. toim. toim. illus. suom. toim. ja suom. tammikuu helmikuu maaliskuu huhtikuu toukokuu kesäkuu heinäkuu elokuu syyskuu lokakuu marraskuu joulukuu tammi helmi maalis huhti touko kesä heinä elo syys loka marras joulu kevät kesä syksy talvi citeproc-py-0.3.0/citeproc/data/locales/locales-fr-CA.xml0000644000076500000240000002517212375162470023732 0ustar brechtmstaff00000000000000 Grégoire Colly This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 consulté le et et autres anonyme anon. sur disponible sur par vers v. cité édition éditions éd. et al. à paraître à l'adresse ibid. dans sous presse Internet entretien lettre sans date s. d. en ligne présenté à référence références réf. réf. consulté échelle version apr. J.-C. av. J.-C. «   » ʳᵉ ᵉʳ premier deuxième troisième quatrième cinquième sixième septième huitième neuvième dixième livre livres chapitre chapitres colonne colonnes figure figures folio folios numéro numéros ligne lignes note notes opus opus page pages paragraphe paragraphes partie parties section sections sub verbo sub verbis verset versets volume volumes liv. chap. col. fig. fᵒ fᵒˢ nᵒ nᵒˢ l. n. op. p. p. paragr. part. sect. s. v. s. vv. v. v. vol. vol. § § § § réalisateur réalisateurs éditeur éditeurs directeur directeurs illustrateur illustrateurs traducteur traducteurs éditeur et traducteur éditeurs et traducteurs réal. réal. éd. éd. dir. dir. ill. ill. trad. trad. éd. et trad. éd. et trad. réalisé par édité par sous la direction de illustré par entretien réalisé par à par traduit par édité et traduit par par réal. par éd. par ss la dir. de ill. par trad. par éd. et trad. par janvier février mars avril mai juin juillet août septembre octobre novembre décembre janv. févr. mars avr. mai juin juill. août sept. oct. nov. déc. printemps été automne hiver citeproc-py-0.3.0/citeproc/data/locales/locales-fr-FR.xml0000644000076500000240000002517412375162470023760 0ustar brechtmstaff00000000000000 Grégoire Colly This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 consulté le et et autres anonyme anon. sur disponible sur par vers v. cité édition éditions éd. et al. à paraître à l'adresse ibid. in sous presse Internet entretien lettre sans date s. d. en ligne présenté à référence références réf. réf. consulté échelle version apr. J.-C. av. J.-C. «   » ʳᵉ ᵉʳ premier deuxième troisième quatrième cinquième sixième septième huitième neuvième dixième livre livres chapitre chapitres colonne colonnes figure figures folio folios numéro numéros ligne lignes note notes opus opus page pages paragraphe paragraphes partie parties section sections sub verbo sub verbis verset versets volume volumes liv. chap. col. fig. fᵒ fᵒˢ nᵒ nᵒˢ l. n. op. p. p. paragr. part. sect. s. v. s. vv. v. v. vol. vol. § § § § réalisateur réalisateurs éditeur éditeurs directeur directeurs illustrateur illustrateurs traducteur traducteurs éditeur et traducteur éditeurs et traducteurs réal. réal. éd. éd. dir. dir. ill. ill. trad. trad. éd. et trad. éd. et trad. réalisé par édité par sous la direction de illustré par entretien réalisé par à par traduit par édité et traduit par par réal. par éd. par ss la dir. de ill. par trad. par éd. et trad. par janvier février mars avril mai juin juillet août septembre octobre novembre décembre janv. févr. mars avr. mai juin juill. août sept. oct. nov. déc. printemps été automne hiver citeproc-py-0.3.0/citeproc/data/locales/locales-he-IL.xml0000644000076500000240000002406212375162470023735 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 גישה ו and others anonymous anon available at by circa c. cited edition editions ed ואחרים forthcoming מתוך שם בתוך in press internet interview letter no date nd online presented at the reference references ref. refs. אוחזר scale version AD BC th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth ספר ספרים פרק פרקים טור טורים figure figures folio folios מספר מספרים שורה שורות note notes אופוס אופרה עמוד עמודים paragraph פיסקה part parts section sections sub verbo sub verbis בית בתים כרך כרכים bk chap col fig f no l. n. op 'עמ 'עמ para pt sec s.v. s.vv. v vv vol vols ¶¶ § §§ director directors עורך עורכים editor editors illustrator illustrators מתרגם מתרגמים editor & translator editors & translators dir. dirs. ed eds ed. eds. ill. ills. tran trans ed. & tran. eds. & trans. directed by נערך ע"י edited by illustrated by interview by to by תורגם ע"י edited & translated by by dir. ed ed. illus. trans ed. & trans. by ינואר פברואר מרץ אפריל מאי יוני יולי אוגוסט ספטמבר אוקטובר נובמבר דצמבר Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Spring Summer Autumn Winter citeproc-py-0.3.0/citeproc/data/locales/locales-hr-HR.xml0000644000076500000240000002410012375162470023750 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 pristupljeno i i ostali anonim anon. na pristupačno na od circa c. citirano izdanje izdanja izd. i ostali u pripremi od ibid. u u štampi internet intervju pismo bez datuma bez datuma na internetu predstavljeno na reference reference ref. ref. preuzeto skala verzija AD BC th st nd rd th th th prvi drugi treći četvrti peti šesti sedmi osmi deveti deseti knjiga knjige poglavlje poglavlja kolona kolone crtež crteži folija folije broj brojevi linija linije beleška beleške opus opera stranica stranice paragraf paragrafi deo delova odeljak odeljaka sub verbo sub verbis strofa strofe tom tomova knj pog kol црт fol izd l n op str. str. par deo od s.v. s.vv. s s tom tomova ¶¶ § §§ director directors priređivač priređivači priređivač priređivači ilustrator ilustratori prevodilac prevodioci priređivač & prevodilac priređivači & prevodioci prir. prir. prir. prir. prir. prir. il. il. prev. prev. prir. & prev. prir. & prev. directed by priredio priredio ilustrovao intervjuisao prima od preveo priredio & preveo by by dir. prir. prir. ilus. prev. prir. & prev. by januar februar mart april maj jun jul avgust septembar oktobar novembar decembar jan. feb. mart apr. maj jun jul avg. sep. okt. nov. dec. proleće leto jesen zima citeproc-py-0.3.0/citeproc/data/locales/locales-hu-HU.xml0000644000076500000240000002377412375162470023776 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 elérés és és mások név nélkül nn available at by circa c. idézi edition editions ed et al. megjelenés alatt forrás ibid. in nyomtatás alatt internet interjú levél no date nd online előadás reference references ref. refs. elérés scale version AD BC » « th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth könyv könyv fejezet fejezet oszlop oszlop ábra ábra fóliáns fóliáns szám szám sor sor jegyzet jegyzet opus opera oldal oldal bekezdés bekezdés rész rész szakasz szakasz sub verbo sub verbis versszak versszak kötet kötet könyv fej oszl ábr fol sz l. n. op o o bek rész szak s.v. s.vv. vsz vsz vol vols ¶¶ § §§ director directors szerkesztő szerkesztő editor editors illustrator illustrators fordító fordító editor & translator editors & translators dir. dirs. szerk szerk ed. eds. ill. ills. ford ford ed. & tran. eds. & trans. directed by szerkesztette edited by illustrated by interjúkészítő címzett by fordította edited & translated by by dir. szerk ed. illus. ford ed. & trans. by január február március április május június július augusztus szeptember október november december jan febr márc ápr máj jún júl aug szept okt nov dec Spring Summer Autumn Winter citeproc-py-0.3.0/citeproc/data/locales/locales-is-IS.xml0000644000076500000240000002343312375162470023764 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 sótt og og fleiri nafnlaus nafnl. af available at eftir sirka u.þ.b. tilvitnun útgáfa útgáfur útg. o.fl. óbirt af sama heimild í í prentun rafrænt viðtal bréf engin dagsetning e.d. rafrænt flutt á tilvitnun tilvitnanir tilv. tilv. sótt scale version e.Kr. f.Kr. . fyrsti annar þriðji fjórði fimmti sjötti sjöundi áttundi níundi tíundi bók bækur kafli kaflar dálkur dálkar mynd myndir handrit handrit númer númer lína línur skilaboð skilaboð tónverk tónverk blaðsíða blaðsíður málsgrein málsgreinar hluti hlutar hluti hlutar sub verbo sub verbis vers vers bindi bindi b. k. d. mynd. handr. nr. l. n. tónv. bls. bls. málsgr. hl. hl. s.v. s.vv. v. v. bindi bindi ¶¶ § §§ director directors ritstjóri ritstjórar ritstjóri ritstjórar illustrator illustrators þýðandi þýðendur ritstjóri og þýðandi ritstjórar og þýðendur dir. dirs. ritstj. ritstj. ritstj. ritstj. ill. ills. þýð. þýð. ritstj. og þýð. ritstj. og þýð. directed by ritstjóri ritstjóri illustrated by viðtal tók til by þýddi ritstjóri og þýðandi eftir dir. ritst. ritst. illus. þýð. ritst. og þýð. janúar febrúar mars apríl maí júní júlí ágúst september október nóvember desember jan. feb. mar. apr. maí jún. júl. ágú. sep. okt. nóv. des. vor sumar haust vetur citeproc-py-0.3.0/citeproc/data/locales/locales-it-IT.xml0000644000076500000240000002337712375162470023775 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 consultato e e altri anonimo anon. a available at di circa c. citato edizione edizioni ed. et al. futuro da ibid. in in stampa internet intervista lettera senza data s.d. in linea presentato al reference references ref. refs. recuperato scale version d.C. a.C. « » ° prima seconda terza quarta quinta sesta settima ottava nona decima libro libri capitolo capitoli colonna colonne figura figure foglio fogli numero numeri riga righe nota note opera opere pagina pagine capoverso capoversi parte parti paragrafo paragrafi sub verbo sub verbis verso versi volume volumi lib. cap. col. fig. fgl. n. l. n. op. pag. pagg. cpv. pt. par. s.v. s.vv. v. vv. vol. vol. ¶¶ § §§ director directors curatore curatori editor editors illustrator illustrators traduttore traduttori curatore e traduttore curatori e tradutori dir. dirs. a c. di a c. di ed. eds. ill. ills. trad. trad. a c. di e trad. da a c. di e trad. da directed by a cura di edited by illustrated by intervista di a by tradotto da a cura di e tradotto da di dir. a c. di ed. illus. trad. da a c. di e trad. da gennaio febbraio marzo aprile maggio giugno luglio agosto settembre ottobre novembre dicembre gen. feb. mar. apr. mag. giu. lug. ago. set. ott. nov. dic. primavera estate autunno inverno citeproc-py-0.3.0/citeproc/data/locales/locales-ja-JP.xml0000644000076500000240000002367712375162470023753 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 アクセス and others anonymous anon at available at by circa c. cited edition editions ed 近刊 から 前掲 in press internet interview letter no date 日付なし online presented at the reference references ref. refs. 読み込み scale version AD BC th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth book books chapter chapters column columns figure figures folio folios number numbers note notes opus opera ページ ページ 段落 段落 part parts section sections sub verbo sub verbis verse verses volume volumes bk chap col fig f l. n. op p p para pt sec s.v. s.vv. v vv vol vols ¶¶ § §§ director directors 編集者 編集者 editor editors illustrator illustrators 翻訳者 翻訳者 editor & translator editors & translators dir. dirs. 編集者 編集者 ed. eds. ill. ills. 翻訳者 翻訳者 ed. & tran. eds. & trans. directed by 編集者: edited by illustrated by interview by to by 翻訳者: edited & translated by by dir. ed ed. illus. trans ed. & trans. by 1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月 1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月 Spring Summer Autumn Winter citeproc-py-0.3.0/citeproc/data/locales/locales-km-KH.xml0000644000076500000240000002473512375162470023755 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 accessed and and others anonymous anon. at available at by circa c. cited edition editions ed. et al. forthcoming from ibid in in press internet interview letter no date n.d. online presented at the reference references ref. refs. retrieved scale version AD BC th st nd rd th th th ទីមួយ ទីពីរ ទីបី ទីបួន ទីប្រាំ ទីប្រាំមួយ ទីប្រាំពីរ ទីប្រាំបី ទីប្រាំបួន ទីដប់មួយ សៀវភៅ សៀវភៅ ជំពូក ជំពូក កាឡោន កាឡោន តួលេខ តួលេខ folio folios ចំនួន ចំនួន បន្ទាត់ បន្ទាត់ កំណត់ចំណាំ កំណត់ចំណាំ opus opera ទំព័រ ទំព័រ កថាខណ្ឌ កថាខណ្ឌ ជំពូក ជំពូក ផ្នែក ផ្នែក sub verbo sub verbis verse verses វ៉ុល វ៉ុល bk. chap. col. fig. f. no. l. n. op. p. pp. para. pt. sec. s.v. s.vv. v. vv. vol. vols. ¶¶ § §§ director directors editor editors editors illustrator illustrators translator translator editor & translator editors & translators dir. dirs. ed. eds. ed. eds. ill. ills. tran. trans. ed. & tran. eds. & trans. directed by edited by edited by illustrated by interview by to by translated by edited & translated by by dir. ed. ed. illus. trans. ed. & trans. by មករា កុម្ភៈ មីនា មេសា ឧសភា មិថុនា កក្កដា សីហា កញ្ញា តុលា វិច្ឆិកា ធ្នូ Jan. Feb. Mar. Apr. May Jun. Jul. Aug. Sep. Oct. Nov. Dec. Spring Summer Autumn Winter citeproc-py-0.3.0/citeproc/data/locales/locales-ko-KR.xml0000644000076500000240000002373512375162470023770 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 접근된 와/과 and others anonymous anon at available at by circa c. cited edition editions ed 기타 근간 (으)로부터 ibid. in in press internet interview letter no date 일자 없음 online presented at the reference references ref. refs. retrieved scale version AD BC th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth book books chapter chapters column columns figure figures folio folios number numbers note notes opus opera 페이지 페이지 단락 단락 part parts section sections sub verbo sub verbis verse verses volume volumes bk chap col fig f l. n. op p pp para pt sec s.v. s.vv. v vv vol vols ¶¶ § §§ director directors 편집자 편집자 editor editors illustrator illustrators 번역자 번역자 editor & translator editors & translators dir. dirs. 편집자 편집자 ed. eds. ill. ills. 번역자 번역자 ed. & tran. eds. & trans. directed by 편집자: edited by illustrated by interview by to by 번역자: edited & translated by by dir. ed ed. illus. trans ed. & trans. by 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월 1 2 3 4 5 6 7 8 9 10 11 12 Spring Summer Autumn Winter citeproc-py-0.3.0/citeproc/data/locales/locales-lt-LT.xml0000644000076500000240000002404012375162470023767 0ustar brechtmstaff00000000000000 Valdemaras Klumbys This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 žiūrėta ir ir kt. anonimas anon. available at circa ca. cituojama pagal leidimas leidimai leid. et al. ruošiamas ibid. spaudoje prieiga per internetą interviu laiškas sine anno s.a. interaktyvus pristatytas nuoroda nuorodos nuor. nuor. gauta scale version po Kr. pr. Kr. , -asis pirmasis antrasis trečiasis ketvirtasis penktasis šeštasis septintasis aštuntasis devintasis dešimtasis knyga knygos skyrius skyriai skiltis skiltys iliustracija iliustracijos lapas lapai numeris numeriai eilutė eilutės pastaba pastabos opus opera puslapis puslapiai pastraipa pastraipos dalis dalys poskyris poskyriai žiūrėk žiūrėk eilėraštis eilėraščiai tomas tomai kn. sk. skilt. il. l. nr. l. n. op. p. p. pastr. d. posk. žr. žr. eilėr. eilėr. t. t. ¶¶ § §§ director directors sudarytojas sudarytojai atsakingasis redaktorius atsakingieji redaktoriai illustrator illustrators vertėjas vertėjai sudarytojas ir vertėjas sudarytojai ir vertėjai dir. dirs. sud. sud. ats. red. ats. red. ill. ills. vert. vert. sud. ir vert. sud. ir vert. directed by sudarė parengė illustrated by interviu ėmė gavo by vertė sudarė ir vertė dir. sud. pareng. illus. vert. sud. ir vert. sausio vasario kovo balandžio gegužės birželio liepos rugpjūčio rugsėjo spalio lapkričio gruodžio saus. vas. kovo bal. geg. birž. liep. rugpj. rugs. spal. lapkr. gruodž. pavasaris vasara ruduo žiema citeproc-py-0.3.0/citeproc/data/locales/locales-lv-LV.xml0000644000076500000240000002765112375162470024006 0ustar brechtmstaff00000000000000 Andris Lupgins This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-12-27T11:40:58+02:00 skatīts m.ē. un un citi anonīms anon. pieejams p.m.ē. apmēram apm. citēts redakcija redakcijas red. u.c. gaidāms no turpat no presē internets intervija vēstule bez datuma b.g. tiešsaiste iesniegts atsauce atsauces ats. ats. iegūts mērogs versija " " " " -ais pirmais otrais trešais ceturtais piektais sestais septītais astotais devītais desmitais pirmā otrā trešā ceturtā piektā sestā septītā astotā devītā desmitā grāmata grāmatas nodaļa nodaļas sleja slejas ilustrācija ilustrācijas folio folio numurs numuri rinda rindas piezīme piezīmes opuss opusi lappuse lappuses rindkopa rindkopas daļa daļas apakšnodaļa apakšnodaļas skatīt skatīt pants panti sējums sējumi grām. nod. sl. il. fo. nr. r. piez. op. lpp. lpp. rindk. d. apakšnod. sk. sk. p. p. sēj. sēj. ¶¶ § §§ krājuma redaktors krājuma redaktori sastādītājs sastādītāji pamatmateriāla autors pamatmateriāla autori vadītājs vadītāji redaktors redaktors galvenais redaktors galvenie redaktori redaktors un tulkotājs redaktors un tulkotājs ilustrators ilustratori intervētājs intervētāji saņēmējs saņēmēji tulkotājs tulkotāji kr. red. kr. red. sast. sast. pamatmat. aut. pamatmat. aut. vad. vad. red. red. galv. red. galv. red. red. un tulk. red. un tulk. ilustr. ilustr. interv. interv. saņ. saņ. tulk. tulk. sastādīja vadīja sagatavoja sagatavoja sagatavoja un tulkoja ilustrēja intervēja saņēma tulkoja sast. sag. sag. ilustr. tulk. sag. un tulk. janvārī februārī martā aprīlī maijā jūnijā jūlijā augustā septembrī oktobrī novembrī decembrī janv. febr. mar. apr. mai. jūn. jūl. aug. sept. okt. nov. dec. pavasaris vasara rudens ziema citeproc-py-0.3.0/citeproc/data/locales/locales-mn-MN.xml0000644000076500000240000002364312375162470023765 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 accessed and and others anonymous anon at available at by circa c. cited edition editions ed et al. forthcoming from ibid. in in press internet interview letter no date n.d. online presented at the reference references ref. refs. retrieved scale version AD BC « » th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth book books chapter chapters column columns figure figures folio folios number numbers line lines note notes opus opera page pages paragraph paragraph part parts section sections sub verbo sub verbis verse verses volume volumes bk chap col fig f no l. n. op p pp para pt sec s.v. s.vv. v vv vol vols ¶¶ § §§ director directors editor editors editor editors illustrator illustrators translator translators editor & translator editors & translators dir. dirs. ed eds ed. eds. ill. ills. tran trans ed. & tran. eds. & trans. directed by edited by edited by illustrated by interview by to by translated by edited & translated by by dir. ed ed. illus. trans ed. & trans. by January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Spring Summer Autumn Winter citeproc-py-0.3.0/citeproc/data/locales/locales-nb-NO.xml0000644000076500000240000002344412375162470023753 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2013-03-01T12:20:00+01:00 åpnet og med flere anonym anon. tilgjengelig på av circa ca. sitert utgave utgaver utg. mfl. kommende fra ibid. i i trykk Internett intervju brev ingen dato udatert online presentert på referanse referanser ref. refr. hentet målestokk versjon fvt. evt. « » . første andre tredje fjerde femte sjette sjuende åttende niende tiende bok bøker kapittel kapitler kolonne kolonner figur figurer folio folioer nummer numre linje linjer note noter opus opus side sider avsnitt avsnitt del deler paragraf paragrafer sub verbo sub verbis vers vers bind bind b. kap. kol. fig. fol. nr. l. n. op. s. s. avsn. d. pargr. s.v. s.vv. v. v. bd. bd. ¶¶ § §§ regissør regissører redaktør redaktører redaktør redaktører illustratør illustratører oversetter oversettere redaktør & oversetter redaktører & oversettere regi regi red. red. red. red. ill. ills. overs. overs. red. & overs. red. & overs. regissert av redigert av redigert av illustrert av intervjuet av til av oversatt av redigert & oversatt av av regi red. red. illus. overs. red. & overs. av januar februar mars april mai juni juli august september oktober november desember jan. feb. mar. apr. mai jun. jul. aug. sep. okt. nov. des. vår sommer høst vinter citeproc-py-0.3.0/citeproc/data/locales/locales-nl-NL.xml0000644000076500000240000002553712375162470023767 0ustar brechtmstaff00000000000000 Rintze Zelle http://twitter.com/rintzezelle This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 bezocht en en anderen anoniem anon. bij beschikbaar op door circa c. geciteerd editie edities ed. e.a. in voorbereiding van ibid. in in druk internet interview brief zonder datum z.d. online gepresenteerd bij referentie referenties ref. refs. geraadpleegd schaal versie AD BC ste de de de de de de de de de de de de de de de de de de eerste tweede derde vierde vijfde zesde zevende achtste negende tiende boek boeken hoofdstuk hoofdstukken column columns figuur figuren folio folio's nummer nummers regel regels aantekening aantekeningen opus opera pagina pagina's paragraaf paragrafen deel delen sectie secties sub verbo sub verbis vers versen volume volumes bk. hfdst. col. fig. f. nr. l. n. op. p. pp. par. deel sec. s.v. s.vv. v. vv. vol. vols. ¶¶ § §§ regisseur regisseurs redacteur redacteuren redacteur redacteuren illustrator illustrators vertaler vertalers redacteur & vertaler redacteuren & vertalers reg. reg. red. red. red. red. ill. ill. vert. vert. red. & vert. red. & vert. geregisseerd door bewerkt door bewerkt door geïllustreerd door geïnterviewd door ontvangen door door vertaald door bewerkt & vertaald door door geregisseerd door bewerkt door bewerkt door geïllustreerd door vertaald door bewerkt & vertaald door januari februari maart april mei juni juli augustus september oktober november december jan. feb. mrt. apr. mei jun. jul. aug. sep. okt. nov. dec. lente zomer herst winter citeproc-py-0.3.0/citeproc/data/locales/locales-nn-NO.xml0000644000076500000240000002341612375162470023766 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2013-03-01T12:20:00+01:00 vitja og med fleire anonym anon. tilgjengeleg på av circa ca. sitert utgåve utgåver utg. mfl. kommande frå ibid. i i trykk Internett intervju brev ingen dato udatert online presentert på referanse referansar ref. refr. henta målestokk versjon fvt. evt. « » . første andre tredje fjerde femte sjette sjuande åttande niande tiande bok bøker kapittel kapittel kolonne kolonner figur figurar folio folioar nummer nummer linje linjer note notar opus opus side sider avsnitt avsnitt del deler paragraf paragrafar sub verbo sub verbis vers vers bind bind b. kap. kol. fig. fol. nr. l. n. op. s. s. avsn. d. par. s.v. s.vv. v. v. bd. bd. ¶¶ § §§ regissør regissørar redaktør redaktørar redaktør redaktørar illustratør illustratørar omsetjar omsetjarar redaktør & omsetjar redaktørar & omsetjarar regi regi red. red. red. red. ill. ills. oms. oms. red. & oms. red. & oms. regissert av redigert av redigert av illustrert av intervjua av til av omsett av redigert & omsett av av regi red. red. illus. oms. red. & oms. av januar februar mars april mai juni juli august september oktober november desember jan. feb. mar. apr. mai jun. jul. aug. sep. okt. nov. des. vår sommar haust vinter citeproc-py-0.3.0/citeproc/data/locales/locales-pl-PL.xml0000644000076500000240000002346212375162470023766 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 udostępniono i i inni anonim anon. na dostępne na przez około ok cytowane wydanie wydania wyd. i in. w przygotowaniu z ibid. w w druku internet wywiad list brak daty b.d. online zaprezentowano na referencja referencje ref. ref. pobrano skala wersja n.e. p.n.e. « » . pierwszy drugi trzeci czwarty piąty szósty siódmy ósmy dziewiąty dziesiąty książka książki rozdział rozdziały kolumna kolumny rycina ryciny folio folio numer numery wers wersy notatka notatki opus opera strona strony akapit akapity część części sekcja sekcje sub verbo sub verbis wers wersy tom tomy książka rozdz. kol. ryc. fol. nr l. n. op. s. ss. akap. cz. sekc. s.v. s.vv. w. w. t. t. ¶¶ § §§ reżyser reżyserzy redaktor redaktorzy edytor edytorzy ilustrator ilustratorzy tłumacz tłumacze redaktor & tłumacz redaktorzy & tłumacze dyr. dyr. red. red. red. red. il. il. tłum. tłum. red.tłum. red.tłum. directed by zredagowane przez zredagowane przez ilustrowane przez by przeprowadzony przez dla przez przetłumaczone przez zredagowane i przetłumaczone przez przez dir. red. red. il. tłum. red.tłum. styczeń luty marzec kwiecień maj czerwiec lipiec sierpień wrzesień październik listopad grudzień sty. luty mar. kwi. maj cze. lip. sie. wrz. paź. lis. grudz. wiosna lato jesień zima citeproc-py-0.3.0/citeproc/data/locales/locales-pt-BR.xml0000644000076500000240000002343012375162470023761 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 acessado e e outros anônimo anon em available at por circa c. citado edição edições ed et al. a ser publicado de ibidem in no prelo internet entrevista carta sem data [s.d.] online apresentado em referência referências ref. refs. recuperado scale version AD BC º primeiro segundo terceiro quarto quinto sexto sétimo oitavo nono décimo livro livros capítulo capítulos coluna colunas figura figuras folio folios número números linha linhas nota notas opus opera página páginas parágrafo parágrafos parte partes seção seções sub verbo sub verbis verso versos volume volumes liv. cap. col. fig. f. l. n. op. p. p. parag. pt. seç. s.v. s.vv. v. vv. vol. vols. ¶¶ § §§ director directors organizador organizadores editor editors illustrator illustrators tradutor tradutores editor e tradutor editores e tradutores dir. dirs. org. orgs. ed. eds. ill. ills. trad. trads. ed. e trad. eds. e trads. directed by organizado por editado por illustrated by entrevista de para by traduzido por editado & traduzido por por dir. org. ed. illus. trad. ed. e trad. por janeiro fevereiro março abril maio junho julho agosto setembro outubro novembro dezembro jan. fev. mar. abr. maio jun. jul. ago. set. out. nov. dez. Primavera Verão Outono Inverno citeproc-py-0.3.0/citeproc/data/locales/locales-pt-PT.xml0000644000076500000240000002373712375162470024013 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 acedido e e outros anónimo anón em disponível em por circa c. citado edição edições ed et al. a publicar de ibid. em no prelo internet entrevista carta sem data sem data em linha apresentado na reference references ref. refs. obtido scale versão AD BC « » th st nd rd th th th primeiro segundo terceiro quarto quinto sexto sétimo oitavo nono décimo livro livros capítulo capítulos coluna colunas figura figuras fólio fólios número número linha linhas nota notas opus opera página páginas parágrafo parágrafos parte partes secção secções sub verbo sub verbis versículo versículos volume volumes liv cap col fig f n l. n. op p pp par pt sec s.v. s.vv. v vv vol vols ¶¶ § §§ director directors editor editores editor editors illustrator illustrators tradutor tradutores editor & translator editors & translators dir. dirs. ed eds ed. eds. ill. ills. trad trads ed. & tran. eds. & trans. directed by editado por edited by illustrated by entrevistado por para by traduzido por edited & translated by by dir. ed ed. illus. trad ed. & trans. by Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Outubro Novembro Dezembro Jan Fev Mar Abr Mai Jun Jul Ago Set Out Nov Dez Primavera Verão Outono Inverno citeproc-py-0.3.0/citeproc/data/locales/locales-ro-RO.xml0000644000076500000240000002375412375162470024004 0ustar brechtmstaff00000000000000 Nicolae Turcan nturcan@gmail.com This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 data accesării și și alții anonim anon. la valabil la de circa cca. citat ediția edițiile ed et al. în curs de apariție din ibidem în sub tipar internet interviu scrisoare fără dată f.a. online prezentat la referință referințe ref. ref. preluat în scală versiunea d.Hr. î.Hr. « » - -lea primul al doilea al treilea al patrulea al cincilea al șaselea al șaptelea al optulea al nouălea al zecelea cartea cărțile capitolul capitolele coloana coloanele figura figurile folio folio numărul numerele linia liniile nota notele opusul opusurile pagina paginile paragraful paragrafele partea părțile secțiunea secțiunile sub verbo sub verbis versetul versetele volumul volumele cart. cap. col. fig. fol. nr. l. n. op. p. pp. par. part. sec. s.v. s.vv. v. vv. vol. vol. ¶¶ § §§ director directori editor editori editor editori ilustrator ilustratori traducător traducători editor & traducător editori & traducători dir. dir. ed. ed. ed. ed. ilustr. ilustr. trad. trad. ed. & trad. ed. & trad. coordonat de ediție de ediție de ilustrații de interviu de în de traducere de ediție & traducere de de dir. ed. ed. ilustr. trad. ed. & trad. de ianuarie februarie martie aprilie mai iunie iulie august septembrie octombrie noiembrie decembrie ian. feb. mar. apr. mai iun. iul. aug. sep. oct. nov. dec. primăvara vara toamna iarna citeproc-py-0.3.0/citeproc/data/locales/locales-ru-RU.xml0000644000076500000240000002541112375162470024010 0ustar brechtmstaff00000000000000 Alexei Kouprianov alexei.kouprianov@gmail.com This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 просмотрено и и др. аноним анон. на available at circa ca. цитируется по цит. по издание издания изд. и др. ожидается от там же в в печати Интернет интервью письмо без даты б. д. online представлено на reference references ref. refs. извлечено scale version н. э. до н. э. « » й первый второй третий четвертый пятый шестой седьмой восьмой девятый десятый книга книги глава главы столбец столбцы рисунок рисунки лист листы выпуск выпуски строка строки примечание примечания сочинение сочинения страница страницы параграф параграфы часть части раздел разделы смотри смотри стих стихи том тома кн. гл. стб. рис. л. l. n. соч. с. с. пара. ч. разд. см. см. ст. ст. т. тт. ¶¶ § §§ director directors редактор редакторы ответственный редактор ответственные редакторы illustrator illustrators переводчик переводчики редактор и переводчик редакторы и переводчики dir. dirs. ред. ред. отв. ред. отв. ред. ill. ills. перев. перев. ред. и перев. ред. и перев. directed by отредактировано отредактировано illustrated by интервью к by переведено отредактировано и переведено dir. ред. отв. ред. illus. перев. ред. и перев. январь февраль март апрель май июнь июль август сентябрь октябрь ноябрь декабрь янв. фев. мар. апр. май июн. июл. авг. сен. окт. ноя. дек. весна лета осень зима citeproc-py-0.3.0/citeproc/data/locales/locales-sk-SK.xml0000644000076500000240000002371312375162470023771 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 cit a a ďalší anonym anon v available at by circa cca. cit vydanie vydania vyd et al nadchádzajúci z ibid. v v tlači internet osobná komunikácia list no date n.d. online prezentované na reference references ref. refs. cit scale version po Kr. pred Kr. th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth kniha knihy kapitola kapitoly stĺpec stĺpce obrázok obrázky list listy číslo čísla riadok riadky poznámka poznámky opus opera strana strany odstavec odstavce časť časti sekcia sekcie sub verbo sub verbis verš verše ročník ročníky k kap stĺp obr l č l. n. op s s par č sek s.v. s.vv. v v roč roč § § director directors editor editori zostavovateľ zostavovatelia illustrator illustrators prekladateľ prekladatelia zostavovateľ & prekladateľ zostavovatelia & prekladatelia dir. dirs. ed ed zost. zost. ill. ills. prel prel ed. & tran. eds. & trans. directed by zostavil zostavil illustrated by rozhovor urobil adresát by preložil zostavil & preložil by dir. ed ed. illus. prel zost. & prel. január február marec apríl máj jún júl august september október november december jan feb mar apr máj jún júl aug sep okt nov dec Jar Leto Jeseň Zima citeproc-py-0.3.0/citeproc/data/locales/locales-sl-SI.xml0000644000076500000240000002375712375162470024000 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 dostopano in in drugi anonimni anon pri available at by circa c. citirano izdaja izdaje iz idr. pred izidom od isto v v tisku internet intervju pismo no date b.d. na spletu predstavljeno na reference references ref. refs. pridobljeno scale version AD BC th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth knjiga knjige poglavje poglavja stolpec stolpci slika slike folio folii številka številke vrstica vrstice opomba opombe opus opera stran strani odstavek odstavki del deli odsek odseki sub verbo sub verbis verz verzi letnik letniki knj pogl sto sl f št l. n. op str str odst del odsk s.v. s.vv. v v let let ¶¶ § §§ director directors urednik uredniki editor editors illustrator illustrators prevajalec prevajalci editor & translator editors & translators dir. dirs. ur ur ed. eds. ill. ills. prev prev ed. & tran. eds. & trans. directed by uredil edited by illustrated by intervjuval za by prevedel edited & translated by by dir. ur ed. illus. prev ed. & trans. by januar februar marec april maj junij julij avgust september oktober november december jan feb mar apr maj jun jul avg sep okt nov dec Spring Summer Autumn Winter citeproc-py-0.3.0/citeproc/data/locales/locales-sr-RS.xml0000644000076500000240000002513412375162470024006 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 приступљено и и остали анонимна анон. на available at by circa c. цитирано издање издања изд. и остали долазећи од ibid. у у штампи Интернет интервју писмо no date без датума на Интернету представљено на reference references ref. refs. преузето scale version AD BC th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth књига књиге поглавље поглавља колона колоне цртеж цртежи фолио фолији број бројеви линија линије белешка белешке опус опера страница странице параграф параграфи део делова одељак одељака sub verbo sub verbis строфа строфе том томова књига Пог. кол. црт. фолио изд. l. n. оп. стр. стр. пар. део од. s.v. s.vv. стр. стр. том томови ¶¶ § §§ director directors уредник урединици editor editors illustrator illustrators преводилац преводиоци editor & translator editors & translators dir. dirs. ур. ур. ed. eds. ill. ills. прев. прев. ed. & tran. eds. & trans. directed by уредио edited by illustrated by интервјуисао прима by превео edited & translated by by dir. ур. ed. illus. прев. ed. & trans. by Јануар Фебруар Март Април Мај Јуни Јули Август Септембар Октобар Новембар Децембар Јан. Феб. Март Апр. Мај Јуни Јули Авг. Сеп. Окт. Нов. Дец. Spring Summer Autumn Winter citeproc-py-0.3.0/citeproc/data/locales/locales-sv-SE.xml0000644000076500000240000002370612375162470024000 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 åtkomstdatum och och andra anonym anon vid tillgänglig vid av cirka ca citerad upplaga upplagor uppl m.fl. kommande från ibid. i i tryck internet intervju brev inget datum nd online presenterad vid referens referenser ref. refs. hämtad scale version e. Kr. f. Kr. e a a e e första andra tredje fjärde femte sjätte sjunde åttonde nionde tionde bok böcker kapitel kapitel kolumn kolumner figur figurer folio folios nummer nummer rad rader not noter opus opera sida sidor stycke stycken del delar avsnitt avsnitt sub verbo sub verbis vers verser volym volumer bok kap kol fig f num l. n. op s ss st del avs s.v. s.vv. vers verser vol vols ¶¶ § §§ director directors redaktör redaktörer editor editors illustratör illustratörer översättare översättare redaktör & översättare redaktörer & översättare dir. dirs. red reds ed. eds. ill. ills. övers övers ed. & tran. eds. & trans. directed by redigerad av edited by illustrated by intervju av till by översatt av edited & translated by by dir. red ed. illus. övers ed. & trans. by Januari Februari Mars April Maj Juni Juli Augusti September Oktober November December Jan Feb Mar Apr Maj Jun Jul Aug Sep Okt Nov Dec Vår Sommar Höst Vinter citeproc-py-0.3.0/citeproc/data/locales/locales-th-TH.xml0000644000076500000240000002746112375162470023771 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 สืบค้น และ และคณะ นิรนาม นิรนาม ที่ available at โดย โดยประมาณ ประมาณ อ้างถึง พิมพ์ครั้งที่ พิมพ์ครั้งที่ พิมพ์ครั้งที่ และคณะ เต็มใจให้ข้อมูล จาก ในที่เดียวกัน ใน กำลังรอตีพิมพ์ อินเทอร์เน็ต การสัมภาษณ์ จดหมาย ไม่ปรากฏปีที่พิมพ์ ม.ป.ป. ออนไลน์ นำเสนอที่ เอกสารอ้างอิง เอกสารอ้างอิง อ้างอิง อ้างอิง สืบค้น scale version ค.ศ. พ.ศ. หนึ่ง สอง สาม สี่ ห้า หก เจ็ด แปด เก้า สิบ หนังสือ หนังสือ บทที่ บทที่ สดมภ์ สดมภ์ รูปภาพ รูปภาพ หน้า หน้า ฉบับที่ ฉบับที่ บรรทัดที่ บรรทัดที่ บันทึก บันทึก บทประพันธ์ บทประพันธ์ หน้า หน้า ย่อหน้า ย่อหน้า ส่วนย่อย ส่วนย่อย หมวด หมวด ใต้คำ ใต้คำ ร้อยกรอง ร้อยกรอง ปีที่ ปีที่ หนังสือ บทที่ สดมภ์ รูปภาพ หน้า ฉบับที่ l. n. บทประพันธ์ น. น. ย่อหน้า ส่วนย่อย หมวด ใต้คำ ใต้คำ ร้อยกรอง ร้อยกรอง ปี ปี ¶¶ § §§ director directors บรรณาธิการ บรรณาธิการ ผู้อำนวยการบทบรรณาธิการ ผู้อำนวยการบทบรรณาธิการ illustrator illustrators ผู้แปล ผู้แปล บรรณาธิการและผู้แปล บรรณาธิการและผู้แปล dir. dirs. บ.ก. บ.ก. ผอ.บทบรรณาธิการ ผอ.บทบรรณาธิการ ill. ills. ผู้แปล ผู้แปล บ.ก. บ.ก. directed by เรียบเรียงโดย เรียบเรียงโดย illustrated by สัมภาษณ์โดย ถึง by แปลโดย แปลและเรียบเรียงโดย โดย dir. โดย โดย illus. แปล แปลและเรียบเรียงโดย มกราคม กุมภาพันธ์ มีนาคม เมษายน พฤษภาคม มิถุนายน กรกฎาคม สิงหาคม กันยายน ตุลาคาม พฤศจิกายน ธันวาคม ม.ค. ก.พ. มี.ค. เม.ย. พ.ค. มิ.ย. ก.ค. ส.ค. ก.ย. ต.ค. พ.ย. ธ.ค. ฤดูใบไม้ผลิ ฤดูร้อน ฤดูใบไม้ร่วง ฤดูหนาว citeproc-py-0.3.0/citeproc/data/locales/locales-tr-TR.xml0000644000076500000240000002345212375162470024011 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 erişildi ve ve diğerleri anonim anonim de available at by circa c. kaynak baskı baskı ed ve diğerleri gelecek adresinden erişildi ibid. içinde basımda internet kişisel iletişim mektup tarih yok y.y. çevrimiçi sunulan reference references ref. refs. tarihinde scale version M.S M.Ö. « » . birinci ikinci üçüncü dördüncü beşinci altıncı yedinci sekizinci dokuzuncu onuncu kitap kitaplar bölüm bölümler sütun sütunlar şekil şekiller folyo folyo sayı sayılar satır satırlar not notlar opus opera sayfa sayfalar paragraf paragraflar kısım kısımlar bölüm bölümler sub verbo sub verbis dize dizeler cilt ciltler kit böl süt şek f sayı l. n. op s ss par kıs böl s.v. s.vv. v vv c c ¶¶ § §§ director directors editör editörler editör editör illustrator illustrators çeviren çevirenler editör & çeviren editörler & çevirenler dir. dirs. ed ed ed. ed. ill. ills. çev. çev. ed. & çev. ed. & çev. directed by editör düzenleyen illustrated by Röportaj yapan to by çeviren düzenleyen & çeviren by dir. ed. ed. illus. çev. ed. & çev. Ocak Şubat Mart Nisan Mayıs Haziran Temmuz Ağustos Eylül Ekim Kasım Aralık Oca Şub Mar Nis May Haz Tem Ağu Eyl Eki Kas Ara Bahar Yaz Sonbahar Kış citeproc-py-0.3.0/citeproc/data/locales/locales-uk-UA.xml0000644000076500000240000002415512375162470023764 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 accessed і та інші анонімний анон. на available at by circa c. cited edition editions ed et al. forthcoming із ibid. в у пресі інтернет інтервю лист no date n.d. online presented at the reference references ref. refs. retrieved scale version AD BC « » th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth book books chapter chapters column columns figure figures folio folios number numbers line lines note notes opus opera page pages paragraph paragraph part parts section sections sub verbo sub verbis verse verses volume volumes bk chap col fig f no l. n. op p pp para pt sec s.v. s.vv. v vv vol vols ¶¶ § §§ director directors editor editors editor editors illustrator illustrators translator translators editor & translator editors & translators dir. dirs. ed eds ed. eds. ill. ills. tran trans ed. & tran. eds. & trans. directed by edited by edited by illustrated by interview by to by translated by edited & translated by by dir. ed ed. illus. trans ed. & trans. by Січень Лютий Березень Квітень Травень Червень Липень Серпень Вересень Жовтень Листопад Грудень Січ Лют Бер Квіт Трав Чер Лип Сер Вер Жов Лис Груд Spring Summer Autumn Winter citeproc-py-0.3.0/citeproc/data/locales/locales-vi-VN.xml0000644000076500000240000002417612375162470024004 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 truy cập and others anonymous anon at available at by circa c. cited edition editions ed và c.s. sắp tới từ n.t. trong in press internet interview letter no date không ngày online presented at the reference references ref. refs. truy vấn scale version AD BC « » th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth book books chapter chapters column columns figure figures folio folios number numbers dòng dòng note notes opus opera trang trang đoạn văn đoạn văn part parts section sections sub verbo sub verbis verse verses volume volumes bk chap col fig f số p.h l. n. op tr tr para pt sec s.v. s.vv. v vv vol vols ¶¶ § §§ director directors biên tập viên biên tập viên editor editors illustrator illustrators biên dịch viên biên dịch viên editor & translator editors & translators dir. dirs. b.t.v b.t.v ed. eds. ill. ills. b.d.v b.d.v ed. & tran. eds. & trans. directed by biên tập bởi edited by illustrated by interview by to by biên dịch bởi edited & translated by by dir. b.t ed. illus. b.d ed. & trans. by Tháng Giêng Tháng Hai Tháng Ba Tháng Tư Tháng Năm Tháng Sáu Tháng Bảy Tháng Tám Tháng Chín Tháng Mười Tháng Mười-Một Tháng Chạp tháng 1 tháng 2 tháng 3 tháng 4 tháng 5 tháng 6 tháng 7 tháng 8 tháng 9 tháng 10 tháng 11 tháng 12 Spring Summer Autumn Winter citeproc-py-0.3.0/citeproc/data/locales/locales-zh-CN.xml0000644000076500000240000002367712375162470023771 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 accessed and and others anonymous anon at available at by circa c. cited edition editions ed et al. forthcoming from ibid. in in press internet interview letter no date nd online presented at the reference references ref. refs. retrieved scale version AD BC th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth book books chapter chapters column columns figure figures folio folios number numbers line line note notes opus opera page pages paragraph paragraph part parts section sections sub verbo sub verbis verse verses volume volumes bk chap col fig f no l. n. op p pp para pt sec s.v. s.vv. v vv vol vols ¶¶ § §§ director directors editor editors editor editors illustrator illustrators translator translators editor & translator editors & translators dir. dirs. ed eds ed. eds. ill. ills. tran trans ed. & tran. eds. & trans. directed by edited by edited by illustrated by interview by to by translated by edited & translated by by dir. ed ed. illus. trans ed. & trans. by January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Spring Summer Autumn Winter citeproc-py-0.3.0/citeproc/data/locales/locales-zh-TW.xml0000644000076500000240000002367012375162470024014 0ustar brechtmstaff00000000000000 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License 2012-07-04T23:31:02+00:00 被取用 及其他 不具名的 無名 available at by circa c. 被引用 版本 版本 等人 將來的 同上出處 印行中 網際網路 訪問 信件 no date 無日期 在線上 簡報於 reference references ref. refs. 被取回 scale version AD BC th st nd rd th th th first second third fourth fifth sixth seventh eighth ninth tenth 對開紙 對開紙 期數 期數 筆記 筆記 作品 作品 段落 段落 sub verbo sub verbis 詩句 詩句 l. n. s.v. s.vv. ¶¶ § §§ director directors 編輯 編輯 editor editors illustrator illustrators 翻譯 翻譯 editor & translator editors & translators dir. dirs. ed. eds. ill. ills. ed. & tran. eds. & trans. directed by 編者是 edited by illustrated by 訪問者是 授與 by 譯者是 edited & translated by by dir. ed. illus. ed. & trans. by 一月 二月 三月 四月 五月 六月 七月 八月 九月 十月 十一月 十二月 1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月 Spring Summer Autumn Winter citeproc-py-0.3.0/citeproc/data/schema/0000755000076500000240000000000012427163401020500 5ustar brechtmstaff00000000000000citeproc-py-0.3.0/citeproc/data/schema/csl-categories.rng0000644000076500000240000000343212375162470024125 0ustar brechtmstaff00000000000000
author-date numeric label note author "generic-base" is reserved for truly generic styles (APA, Harvard, etc.). anthropology astronomy biology botany chemistry communications engineering generic-base geography geology history humanities law linguistics literature math medicine philosophy physics political_science psychology science social_science sociology theology zoology Categories can be redefined in a customization schema, though please report obvious gaps for inclusion in the schema.
citeproc-py-0.3.0/citeproc/data/schema/csl-terms.rng0000644000076500000240000000700312375162470023130 0ustar brechtmstaff00000000000000
Terms accessed Miscellaneous Terms ad and and others anonymous at bc by circa cited edition et-al forthcoming from ibid in in press internet interview letter no date online presented at reference retrieved month-01 Months month-02 month-03 month-04 month-05 month-06 month-07 month-08 month-09 month-10 month-11 month-12 season-01 Seasons season-02 season-03 season-04 open-quote Quotes close-quote open-inner-quote close-inner-quote ordinal-01 Ordinals ordinal-02 ordinal-03 ordinal-04 long-ordinal-01 Long Ordinals long-ordinal-02 long-ordinal-03 long-ordinal-04 long-ordinal-05 long-ordinal-06 long-ordinal-07 long-ordinal-08 long-ordinal-09 long-ordinal-10 Contributor Roles editortranslator Categories Locators Locators book chapter column figure folio issue line note opus page paragraph part section sub verbo verse volume
citeproc-py-0.3.0/citeproc/data/schema/csl-types.rng0000644000076500000240000000264212375162470023146 0ustar brechtmstaff00000000000000
CSL Types article article-journal article-magazine article-newspaper bill book broadcast chapter entry entry-dictionary entry-encyclopedia figure graphic interview legal_case legislation manuscript map motion_picture musical_score pamphlet paper-conference patent personal_communication post post-weblog report review review-book song speech thesis treaty webpage
citeproc-py-0.3.0/citeproc/data/schema/csl-variables.rng0000644000076500000240000001546612375162470023762 0ustar brechtmstaff00000000000000
Contributor Roles author collection-editor use for series editor composer container-author use for book author when citing a book chapter editor editorial-director interviewer original-author recipient translator
Dates accessed container event-date issued original-date submitted
Numbers edition issue number number-of-volumes volume
Simple Variables abstract annote notes made by a reader about the content of the resource archive the name of the archive archive_location the location within an archival collection (for example, box and folder) archive-place the place of the archive authority issuing authority (for patents) or judicial authority (such as court for legal cases) call-number chapter-number citation-number the number used for the in-text citation mark in numeric styles citation-label the label used for the in-text citation mark in label styles collection-number collection number; for example, series number collection-title the tertiary title for the cited item; for example, a series title container-title the secondary title for the cited item (book title for book chapters, journal title for articles, etc.). DOI edition an edition description event the name or title of a related event such as a conference or hearing event-place the location or place for the related event first-reference-note-number The number of a preceding note containing the first reference to this item. Relevant only for note-based styles, and null for first references. genre ISBN issue the issue number for the container publication jurisdiction For legislation and patents; scope of geographic relevance for a document. keyword locator a description to locate an item within some larger container or collection; a volume or issue number is a kind of locator, for example. medium medium description (DVD, CD, etc.) note a short inline note, often used to refer to additional details of the resource number a document number; useful for reports and such number-of-pages refers to the number of pages in a book or other document number-of-volumes refers to the number of items in multi-volume books and such original-publisher the name of the original publisher original-publisher-place the place of the original publisher original-title title of a related original version; often useful in cases of translation page the range of pages an item covers in a containing item page-first the first page of an item within a containing item publisher the name of the publisher publisher-place the place of the publisher references for related referenced resources; used for legal case histories, but may be relevant for other contexts. section a section description (for newspapers, etc.) status the (typically publication) status of an item; for example "forthcoming" title the primary title for the cited item URL version volume volume number for the container periodical year-suffix The year suffix for author-date styles; e.g. the 'a' in '1999a'.
citeproc-py-0.3.0/citeproc/data/schema/csl.rng0000644000076500000240000015774612375162470022024 0ustar brechtmstaff00000000000000 Citation Style Language Bruce D'Arcus Simon Kornblith Frank Bennett Rintze Zelle Bruce D'Arcus and Simon Kornblith, 2007-2010 Permission to freely use, copy and distribute. Citation Style Language (CSL) schema for describing bibliographic and citation formatting. Root element. cs:style for CSL styles, cs:locale for locales-xx-XX.xml files Subparts of the CSL schema This macro call has no corresponding macro. This macro call has no corresponding macro.
The CSL data model consists of resources and variables. Primary resources are the citation object itself, as well as related agents and events. Variables are attributes of the resource: titles, dates, volume numbers, and so forth. From the perspective of CSL, resources templates involve a list of variables. By contrast, a variable can be accessed directly. In addition, CSL also contains structures for macros and parameter options. Indicates with which version of the CSL schema the style is compatible 1.0 Default style locale (optional) Style type (in-text citations or note-based) in-text note
Style Metadata The Content model for CSL metadata is borrowed from Atom. The category element may be used to specify the citation format of the style (using the citation-format attribute) and the fields or disciplines for which the style is relevant (using the field attribute). As in Atom, the cs:id element is a required URI that is globally-unique and persistant. To allow styles to be automatically updated, the URI of a style should not change once assigned. Ideally, the URI resolves to the correct CSL file: it should preferably point to the CSL style itself in case of independent styles, and to the independent-parent style in case of dependent styles. For transformation to Atom, the rel values should be expanded to include the base URI <http://purl.org/net/xbiblio/csl/relations#>. self The URI of the CSL style itself. Used for automatic style updating. independent-parent The CSL style URI whose configuration content should be used for processing. Required for dependent styles. template The CSL style URI from which the current style is derived. documentation A documentation URI for the style. For journal-dedicated styles the journal's ISSNs or ISSN-L may be included. A valid ISSN(-L) consists of: four digits, a hyphen, three digits, and a check digit, which can be a numeral digit or a roman X, e.g. "1234-1231". \d{4}\-\d{3}(\d|x|X) \d{4}\-\d{3}(\d|x|X) a required update date-time stamp; for example, 2007-10-26T21:32:52+02:00
Localization Describes the structure of standalone locale files Specifies the locale of the locale file. Indicates with which version of the CSL schema the locale file is compatible 1.0 In styles, cs:locale can be used to override localized terms, dates and options. Specifies the locale to override. A cs:locale element without the xml:lang attribute can also be used: it overrides the content of all locales, but is in turn overridden by cs:locale elements with the xml:lang attribute. "verb-short" reverts to "verb" if the "verb-short" form is not available "symbol" reverts to "short" if the "symbol" form is not available "verb" and "short" revert to "long" if the specified form is not available long verb short verb-short symbol
Extension structures. You may override these in a customization schema. If you do, please contact the xbiblio project to add the term or form to the formal controlled list in the schema.
Simple terms are basic strings, used to represent genres, media, etc. Compound terms are those whose output can be either singular or plural. Typically used for things like page number or editor labels. Instances of cs:date for which the form attribute is set are localized by default. Localized date formats can be overridden. Declares the type of date being defined. text Text form of the date (e.g. "December 15, 2005" for en-US). numeric Numeric form of the date (e.g. "12-15-2005" for en-US) No affixes may be applied to cs:date in cs:locale Locale specific options. Localized global options are specified as attributes in the cs:style-options element. If future versions of CSL include localized options that are citation or bibliography specific, the elements cs:citation-options and cs:bibliography-options can be added. Determines whether punctuation (commas and periods) goes within the quotation marks, or outside (default).
Macros The macro element works something like in BibTeX, and provides a ready-made bundle of formatting templates that can be easily reused elsewhere.
Citation and Bibliography The cs:citation handles printing of citations. A citation may consist of one or more references to bibliographic sources. These references can either be simple in-text keys [doe99] or numeric markers [1], or more complex short descriptors common in author-date (Doe, 1999a) or note styles.
Contributor Names Options for cs:names, available for cs:style, cs:citation and cs:bibliography. Delimiter between names (delimiter between variables is on <names> tag, where it should be). This is ", " in "J. Doe, S. Smith." the delimiter between name groups Options for cs:name, available for cs:style, cs:citation and cs:bibliography. Indicates long (first name + last name, for Western names) or short (last name only, for Western names) form of name. Default is long form. The "count" form is used to return the count of the contributor list, and may be used in special sorting routines. long short count Delimiter between names (delimiter between variables is on <names> tag, where it should be). This is ", " in "J. Doe, S. Smith." Controls appearance of "and"/"&". To disable, do not specify. text symbol Delimiter preceding the last name in a name list contextual Default behavior; delimiter is included for name lists of length three or more: 2 authors: "J. Doe and T. Timmons," 3 authors: "J. Doe, S. Smith, and T. Timmons" (note comma preceding 'and'). always Delimiter is always included 2 author result: "J. Doe, and T. Timmons" 3 authors: "J. Doe, S. Smith, and T. Timmons" (note comma preceding 'and'). never Delimiter is never included 2 authors: "J. Doe and T. Timmons," 3 authors: "J. Doe, S. Smith and T. Timmons" Specifies when "et al." name list abbreviation is used et-al-min: the minimum number of contributors to use "et al." et-al-use-first: the number of contributors to print before "et al." et-al-subsequent-*: as above, but for subsequent citations Indicates whether given name parts ought to be given as initials (e.g., J. K. Rowling) and the text to follow each initial. Sets the author name order to correspond to the sort order of the bibliography; e.g. Doe, John (name-as-sort-order) vs. John Doe (w/o attribute). first Applies name-as-sort-order to first author only. all Applies name-as-sort-order to all authors. The delimiter for personal name parts where sort order differs from display order (for example, in standard Western names). This is the ", " in "Doe, John." Short version of "names" element, without children, allowed in <substitute> Indicates long (first name + last name, for Western names) or short (last name only, for Western names) form of name. Default is long form. The "count" form is used to return the count of the contributor list, and may be used in special sorting routines. long short count Delimiter between names (delimiter between variables is on <names> tag, where it should be). This is ", " in "J. Doe, S. Smith." Allows for separate configuration of name part formatting. For example, Jane DOE. Order of these elements is not significant. family given Similar to label as below, but inherits variable from <names> tag Configures formatting of the et al substitution. Only necessary to deviate from default rendering (for example, to italicize the string). term to use for et al substitution; "et-al" is default et-al and others Substitutions, if the name does not exist
Dates Localized date formats are specified by setting `form`. The default date format can be changed for all locales by configuring the date-parts attribute and date-part elements. text Use the localized text form of the date (e.g. "December 15, 2005" for en-US). numeric Use the localized numeric form of the date (e.g. "12-15-2005" for en-US) The date-parts attribute may be set to show fewer date elements. year-month-day Year, month and day (default) year-month Year and month year Year only For localized dates, date-part can be used to override layout options as defined in the locales (except for affixes, which are locale-specific), e.g. to force the use of leading-zeros, or the short month form. The inclusion of date-parts does not affect which, and in what order, the date-parts are rendered. Non-localized dates are formatted by including, in the desired order, the relevant `date-part`-elements, and by applying formatting, affixes on cs:date and cs:date-part. The default delimiter for date ranges is the en-dash. If the range-delimiter attribute is set for the largest date-part ("day", "month" or "year") that differs between the two dates of the date range, its value is used instead. Month formats: long (default): January short: Jan numeric: 1 numeric-leading-zeros: 01 month long short numeric numeric-leading-zeros Day formats: numeric (default): 5 numeric-leading-zeros: 05 ordinal: 5th day numeric numeric-leading-zeros ordinal Year formats: long (default): 2005 short: 05 year short long
Formatting Text The cs:text element is the main formatting element used to layout down content. render macro output render localized term term plurality: single ("false", default) or multiple ("true") render verbatim text. render variable short long The number markup directive matches the first number found in a field, and returns only that component. If no number is detected, the result is empty. A non-empty number may be subject to further formatting consisting of a form attribute whose value may be numeric, ordinal or roman to format it as a simple number (the default), an ordinal number (1st, 2nd, 3rd etc), a long-ordinal (first, second, third, etc), or roman (i, ii, iii, iv etc). The text-case can also apply to capitalize the roman numbers for instance. The other normal formatting rules apply too (font-style, ...). When used in a conditional, number tests if there is a number present, allowing conditional formatting. numeric ordinal roman long-ordinal
Label Text The label element is used to print text terms that depend on document content for pluralization. For labeling pages, this is preferable, as pages may be either singular or plural (p. or pp.) page locator modifies pluralization behavior (defaults to "contextual") always never contextual
Groups cs:group and its child elements are suppressed if a) at least one rendering element in cs:group calls a variable (either directly or via a macro), and b) all variables that are called are empty.
Options Determines whether the non-dropping particle is demoted in inverted names (e.g. "Koning, W. de"). Defaults to "display-and-sort". never sort-only display-and-sort Determines whether compound given names (e.g. "Jean-Luc") are initialized with (J-L) or without a hyphen (JL). Defaults to true. Abbreviation setting of ranges in the page variable (by default no reformatting is applied to the input data). expanded minimal chicago The collapse options control citation collapsing. citation-number collapses numeric citations from [1, 2, 3] to [1-3] year collapses cites from (Doe 2000, Doe 2001) to (Doe 2000, 2001) year-suffix collapses as "year", but also collapses (Doe 2000a, Doe 2000b) to (Doe 2000a, b). Collapses as "year" when disambiguate-add-year-suffix is not set to "true". year-suffix-ranged collapses as "year-suffix", but also collapses ranges of year-suffix markers, so (Doe 2000a, Doe 2000b, Doe 2000c) becomes (Doe 2000a-c). Collapses as "year" when disambiguate-add-year-suffix is not set to "true". Specifies the delimiter between year-suffix elements, when year-suffix collapsing takes place. If not set the delimiter defaults to that specified for the citation layout. Specifies the delimiter following a group of collapsed cites. When set true, add further names to uniquely identify the target source, overriding the constraint imposed by et-al-subsequent-use-first. The exact rendering of any names added is determined by applying, in order: the form ("long" or "short"); the initialize-with attribute, if present; and a given name disambiguation rule, if disambiguate-add-givenname is set true. When set true, transform names as required by by the rule specified by givenname-disambiguation-rule, or use the "all-names" rule by default. Note that, all of the given name disambiguation rules except for the "by-cite" rule, a name transformation will affect the way the name is rendered in multiple references. Adds a year-suffix (e.g., 2007a) when there are two works by the same author published in the same year included in one bibliography. all-names The default given name disambiguation rule. A given name is first formatted as specified by the attributes to name (form, initialize-with). If the resulting name does not uniquely identify the full name of the individual, it is progressively transformed in the following progression, until disambiguation succeeds: 1. "short" becomes "long" + "initialize-with" if the latter is defined 2. "long" + "initialize-with" becomes "long" if the former is defined 3. "short" becomes "long" Note that if the name begins in long form with the given name as initials, step 1 in this list will be skipped. Likewise, if the name begins in short form and the initialize-with attribute is not set, steps 1 and 2 will be skipped. If the name begins in long form, this option will have no effect. all-names-with-initials Same as the "all-names" rule above, but omitting steps 2 and 3 of that rule. primary-name Same as the "all-names" rule above, but ambiguity is only checked for the first-listed name source, and only first-listed names are affected by the transformation. primary-name-with-initials Same as the "primary-name" rule above, but omitting steps 2 and 3 of that rule. by-cite Apply the transformation described under the "all-names" rule above, but limit the transformation to the current source. The appearance of the name in other references will not be affected. The number of notes (footnotes or endnotes) within which a preceding reference to the same source must occur in order for position="near-note" to be true. Defaults to 5. If "true", bibliographic entries are rendered with hanging-indents. Defines spacing between entries and between lines (measured in number of lines). Both attributes default to 1. Aligns any subsequent lines of a bibliography entry with the beginning of the second field. If set to "margin", the first field is put in the margin and all subsequent lines of text are aligned with the margin. flush margin Substitutes subsequent recurrences of an author for a given string.
Sorting Specifies the sort order within citations or the bibliography. By default, items are sorted in the order cited. Default sort order is ascending ascending descending names-min and names-use-first can be used to (further) constrain the number of names used in a name sort, overriding the values set on the et-al abbreviation attributes.
Conditional Statements The choose elements provides a simple conditional structure. The contents of an <if disambiguate="true"> block is only rendered if it disambiguates two otherwise identical citations. This attempt at disambiguation will only be made when all other disambiguation methods have failed to uniquely identify the target source. true Tests whether the given variables contain numeric data Tests whether the given date variables contain uncertain dates Tests whether the locator matches the given locator variables The boolean operators below indicate the relative position of a reference within the document. These should be checked in the order shown below: "first" is true only once, on the first use of the reference; when "ibid-with-locator" is true, "ibid" and "subsequent are also true; and when "ibid" is true, "subsequent" is also true. The "near-note" operator is true if and only if the reference has been used within five footnotes (or endnotes, as the case may be), counting backward from the current note. This threshold may be adjusted using the "near-note-distance" option. The value of "near-note" is *always* false for references that are not in a footnote/endnote. first subsequent ibid ibid-with-locator near-note Tests whether the item matches the given types Tests whether the given variables contain non-empty values Specifies the test criterion (default is all) all: a condition tests "true" when it tests "true" for all of the given condition values any: a condition tests "true" when it tests "true" for any of the given condition values none: a condition tests "true" when it tests "true" for none of the given condition values all any none
Formatting attributes. The text of each individual cite is normally formatted as a single continuous run of text. Portions of the cite text can be specially positioned using the display attribute. block Set the display value set to "block" to place the content in a block stretching from margin to margin. left-margin Set the display value set to "left-margin" to place the content in a block of fixed width starting at the left margin. All "left-margin" blocks in a bibliography share the same width, set according to the maximum number of characters appearing in any one such block. right-inline Set the display value to "right-inline" to place the content in a block directly to the right of any immediately preceding "left-margin" block, and extending to the right margin. indent Set the display value to "indent" to block-indent the text to the right by a standard amount. attributes are drawn directly from CSS and FO where possible italic normal oblique normal small-caps normal bold light none underline baseline sup sub When set to true (false is the default), quotes (defined as terms) are placed around the rendered text. Nested quotes flipflop. Removes any periods from the rendered text (defaults to false) lowercase display all text as lowercase uppercase display all text as uppercase capitalize-first capitalize first character; other characters displayed as is capitalize-all capitalize first character of every word; other characters displayed lowercase title display as title case (the Chicago Manual of Style calls this "headline style") sentence display as sentence case/sentence style
citeproc-py-0.3.0/citeproc/data/styles/0000755000076500000240000000000012427163401020563 5ustar brechtmstaff00000000000000citeproc-py-0.3.0/citeproc/data/styles/harvard1.csl0000644000076500000240000001470312375162470023012 0ustar brechtmstaff00000000000000 citeproc-py-0.3.0/citeproc/formatter/0000755000076500000240000000000012427163401020332 5ustar brechtmstaff00000000000000citeproc-py-0.3.0/citeproc/formatter/__init__.py0000644000076500000240000000004012375162470022444 0ustar brechtmstaff00000000000000 from . import plain, html, rst citeproc-py-0.3.0/citeproc/formatter/html.py0000644000076500000240000000234212375162470021660 0ustar brechtmstaff00000000000000 from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * try: from html import escape except ImportError: from cgi import escape def preformat(text): return escape(str(text), quote=False) class TagWrapper(str): tag = None attributes = None @classmethod def _wrap(cls, text): if cls.attributes: attrib = ' ' + ' '.join(['{}="{}"'.format(key, value) for key, value in cls.attributes.items()]) else: attrib = '' return '<{tag}{attrib}>{text}'.format(tag=cls.tag, attrib=attrib,text=text) def __new__(cls, text): return super(TagWrapper, cls).__new__(cls, cls._wrap(text)) class Italic(TagWrapper): tag = 'i' class Oblique(Italic): pass class Bold(TagWrapper): tag = 'b' class Light(TagWrapper): tag = 'l' class Underline(TagWrapper): tag = 'u' class Superscript(TagWrapper): tag = 'sup' class Subscript(TagWrapper): tag = 'sub' class SmallCaps(TagWrapper): tag = 'span' attributes = {'style': 'font-variant:small-caps;'} citeproc-py-0.3.0/citeproc/formatter/plain.py0000644000076500000240000000045412375162470022021 0ustar brechtmstaff00000000000000 from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * def preformat(text): return text Italic = str Oblique = str Bold = str Light = str Underline = str Superscript = str Subscript = str SmallCaps = str citeproc-py-0.3.0/citeproc/formatter/rst.py0000644000076500000240000000151612400036427021515 0ustar brechtmstaff00000000000000 from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * def escape(text): text = text.replace('*', '\*') text = text.replace('`', '\`') return text def preformat(text): return escape(str(text)) class RoleWrapper(str): role = None @classmethod def _wrap(cls, text): return ':{role}:`{text}`'.format(role=cls.role, text=text) def __new__(cls, text): return super(RoleWrapper, cls).__new__(cls, cls._wrap(text)) class Italic(RoleWrapper): role = 'emphasis' class Oblique(Italic): pass class Bold(RoleWrapper): role = 'strong' Light = str Underline = str class Superscript(RoleWrapper): role = 'superscript' class Subscript(RoleWrapper): role = 'subscript' SmallCaps = str citeproc-py-0.3.0/citeproc/frontend.py0000644000076500000240000000752412377730357020546 0ustar brechtmstaff00000000000000 from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * import os from warnings import warn from lxml import etree from . import SCHEMA_PATH, LOCALES_PATH, STYLES_PATH from .model import CitationStylesElement from .formatter import html class CitationStylesXML(object): def __init__(self, f, validate=True): lookup = etree.ElementNamespaceClassLookup() namespace = lookup.get_namespace('http://purl.org/net/xbiblio/csl') namespace[None] = CitationStylesElement namespace.update(dict([(cls.__name__.replace('_', '-').lower(), cls) for cls in CitationStylesElement.__subclasses__()])) self.parser = etree.XMLParser(remove_comments=True, encoding='UTF-8', no_network=True) self.parser.set_element_class_lookup(lookup) self.xml = etree.parse(f, self.parser)#, base_url=".") if validate: self.schema = etree.RelaxNG(etree.parse(SCHEMA_PATH)) if not self.schema.validate(self.xml): err = self.schema.error_log #raise Exception("XML file didn't pass schema validation:\n%s" % err) warn("XML file didn't pass schema validation:\n%s" % err) # TODO: proper error reporting self.root = self.xml.getroot() class CitationStylesLocale(CitationStylesXML): def __init__(self, locale, validate=True): locale_path = os.path.join(LOCALES_PATH, 'locales-{}.xml'.format(locale)) try: super(CitationStylesLocale, self).__init__(locale_path, validate=validate) except IOError: raise ValueError("'{}' is not a known locale".format(locale)) class CitationStylesStyle(CitationStylesXML): def __init__(self, style, locale=None, validate=True): try: if not os.path.exists(style): style = os.path.join(STYLES_PATH, '{}.csl'.format(style)) except TypeError: pass try: super(CitationStylesStyle, self).__init__( style, validate=validate) except IOError: raise ValueError("'{}' is not a known style".format(style)) if locale is None: locale = self.root.get('default-locale', 'en-US') self.root.set_locale_list(locale, validate=validate) def has_bibliography(self): return self.root.bibliography is not None def render_citation(self, citation, cites, callback=None): return self.root.citation.render(citation, cites, callback) def sort_bibliography(self, citation_items): return self.root.bibliography.sort(citation_items) def render_bibliography(self, citation_items): return self.root.bibliography.render(citation_items) class CitationStylesBibliography(object): def __init__(self, style, source, formatter=html): self.style = style self.source = source self.formatter = self.style.root.formatter = formatter self.keys = [] self.items = [] self._cites = [] def register(self, citation, callback=None): citation.bibliography = self for item in citation.cites: if item.key in self.source: if item.key not in self.keys: self.keys.append(item.key) self.items.append(item) elif callback is not None: callback(item) def sort(self): self.items = self.style.sort_bibliography(self.items) self.keys = [item.key for item in self.items] def cite(self, citation, callback): return self.style.render_citation(citation, self._cites, callback) def bibliography(self): return self.style.render_bibliography(self.items) citeproc-py-0.3.0/citeproc/model.py0000644000076500000240000015635712422671043020023 0ustar brechtmstaff00000000000000from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * import re import unicodedata import sys from functools import reduce, cmp_to_key from operator import itemgetter from lxml import etree from . import NAMES, DATES, NUMBERS from .source import VariableError, DateRange, LiteralDate from .string import String # Base class class SomewhatObjectifiedElement(etree.ElementBase): nsmap = {'cs': 'http://purl.org/net/xbiblio/csl', 'xml': 'http://www.w3.org/XML/1998/namespace'} # TODO: what about multiple instances of the same name? def __getattr__(self, name): return self.find('cs:' + name, self.nsmap) class CitationStylesElement(SomewhatObjectifiedElement): _default_options = {# global options 'initialize-with-hyphen': 'true', 'page-range-format': None, 'demote-non-dropping-particle': 'display-and-sort', # inheritable name(s) options 'and': None, 'delimiter-precedes-et-al': 'contextual', 'delimiter-precedes-last': 'contextual', 'et-al-min': 0, 'et-al-use-first': 1, 'et-al-subsequent-min': 0, 'et-al-subsequent-use-first': 1, 'et-al-use-last': 'false', 'initialize-with': None, 'name-as-sort-order': None, 'sort-separator': ', ', 'name-form': 'long', 'name-delimiter': ', ', 'names-delimiter': ''} def get_root(self): return self.getroottree().getroot() def xpath_search(self, expression): return self.xpath(expression, namespaces=self.nsmap) @property def loc(self): full_xpath = self.getroottree().getpath(self) xpath = '' tree = [] for i, node in enumerate(full_xpath.split('/')[1:]): xpath += '/' + node element = self.xpath(xpath)[0] namespace, tag = element.tag.split('}', 1) attribs = ''.join(' {}="{}"'.format(key, value) for key, value in element.attrib.items()) tree.append('{:>4}: {}<{}{}>'.format(element.sourceline, i * ' ', tag, attribs)) print('\n'.join(tree)) def get_option(self, name): return self.get(name, self._default_options[name]) def get_macro(self, name): expression = "cs:macro[@name='{}'][1]".format(name) return self.get_root().xpath_search(expression)[0] def get_layout(self): return self.xpath_search('./ancestor-or-self::cs:layout[1]')[0] def get_formatter(self): if isinstance(self.get_root(), Locale): return self.get_root().style.formatter else: return self.get_root().formatter def preformat(self, text): return self.get_formatter().preformat(text) def unicode_character(self, name): return self.preformat(unicodedata.lookup(name)) def render(self, *args, **kwargs): return self.markup(self.process(*args, **kwargs)) # TODO: Locale methods def get_term(self, name, form=None): if isinstance(self.get_root(), Locale): return self.get_root().get_term(name, form) else: for locale in self.get_root().locales: try: return locale.get_term(name, form) except IndexError: # TODO: create custom exception continue def get_date(self, form): for locale in self.get_root().locales: try: return locale.get_date(form) except IndexError: continue def get_locale_option(self, name): for locale in self.get_root().locales: try: return locale.get_option(name) except IndexError: continue # Top level elements class Style(CitationStylesElement): _locale_fallback = {'de-AT': 'de-DE', 'de-CH': 'de-DE', 'en-GB': 'en-US', 'pt-BR': 'pt-PT', 'zh-TW': 'zh-CN'} def set_locale_list(self, output_locale, validate=True): """Set up list of locales in which to search for localizable units""" from .frontend import CitationStylesLocale def search_locale(locale): return self.xpath_search('./cs:locale[@xml:lang="{}"]' .format(locale))[0] self.locales = [] # 1) (in-style locale) chosen dialect try: self.locales.append(search_locale(output_locale)) except IndexError: pass # 2) (in-style locale) matching language language = output_locale.split('-')[0] try: self.locales.append(search_locale(language)) except IndexError: pass # 3) (in-style locale) no language set try: expr = './cs:locale[not(@xml:lang)]' self.locales.append(self.xpath_search(expr)[0]) except IndexError: pass # 4) (locale files) chosen dialect try: self.locales.append(CitationStylesLocale(output_locale, validate=validate).root) except ValueError: pass # 5) (locale files) fall back to primary language dialect try: fallback_locale = self._locale_fallback[output_locale] self.locales.append(CitationStylesLocale(fallback_locale, validate=validate).root) except KeyError: pass # 6) (locale files) default locale (en-US) if output_locale != 'en-US': self.locales.append(CitationStylesLocale('en-US', validate=validate).root) for locale in self.locales: locale.style = self class Locale(CitationStylesElement): _default_options = {'limit-day-ordinals-to-day-1': 'false', 'punctuation-in-quote': 'false'} def get_term(self, name, form=None): attributes = "@name='{}'".format(name) if form is not None: attributes += " and @form='{}'".format(form) else: attributes += " and not(@form)" expr = './cs:term[{}]'.format(attributes) try: return self.terms.xpath_search(expr)[0] except AttributeError: raise IndexError def get_date(self, form): expr = "./cs:date[@form='{}']".format(form) return self.xpath_search(expr)[0] def get_option(self, name): options = self.find('cs:style-options', self.nsmap) if options is None: raise IndexError return options.get(name, self._default_options[name]) def get_formatter(self): return self.style.formatter class FormattingInstructions(object): def get_option(self, name): if name in self._default_options: return self.get(name, self._default_options[name]) else: return self.get(name, self.get_root().get_option(name)) def render(self, reference): raise NotImplementedError class Citation(FormattingInstructions, CitationStylesElement): _default_options = {# disambiguation 'disambiguate-add-names': False, 'disambiguate-add-givenname': False, 'givenname-disambiguation-rule': 'all-names', 'disambiguate-add-year-suffix': False, # citation collapsing 'collapse': None, 'year-suffix-delimiter': None, 'after-collapse-delimiter': None, # note distance 'near-note-distance': 5} def render(self, citation, cites, callback): self.cites = cites return self.layout.render_citation(citation, callback) class Bibliography(FormattingInstructions, CitationStylesElement): _default_options = {# whitespace 'hanging-indent': False, 'second-field-align': None, 'line-spacing': 1, 'entry-spacing': 1, # reference grouping 'subsequent-author-substitute': None} def sort(self, citation_items): return self.layout.sort_bibliography(citation_items) def render(self, citation_items): return self.layout.render_bibliography(citation_items) # Style behavior class Formatted(object): def format(self, string): if isinstance(string, (int, float)): string = str(string) text = self.font_style(string) text = self.font_variant(text) text = self.font_weight(text) text = self.text_decoration(text) text = self.vertical_align(text) return text def font_style(self, text): formatter = self.get_formatter() font_style = self.get('font-style', 'normal') if font_style == 'normal': formatted = text elif font_style == 'italic': formatted = formatter.Italic(text) elif font_style == 'oblique': formatted = formatter.Oblique(text) return formatted def font_variant(self, text): formatter = self.get_formatter() font_variant = self.get('font-variant', 'normal') if font_variant == 'normal': formatted = text elif font_variant == 'small-caps': formatted = formatter.SmallCaps(text) return formatted def font_weight(self, text): formatter = self.get_formatter() font_weight = self.get('font-weight', 'normal') if font_weight == 'normal': formatted = text elif font_weight == 'bold': formatted = formatter.Bold(text) elif font_weight == 'light': formatted = formatter.Light(text) return formatted def text_decoration(self, text): formatter = self.get_formatter() text_decoration = self.get('text-decoration', 'none') if text_decoration == 'none': formatted = text elif text_decoration == 'underline': formatted = formatter.Underline(text) return formatted def vertical_align(self, text): formatter = self.get_formatter() vertical_align = self.get('vertical-align', 'baseline') if vertical_align == 'baseline': formatted = text elif vertical_align == 'sup': formatted = formatter.Superscript(text) elif vertical_align == 'sub': formatted = formatter.Subscript(text) return formatted class Affixed(object): def wrap(self, string): prefix = self.get('prefix', '') suffix = self.get('suffix', '') return prefix + string + suffix class Delimited(object): def join(self, strings, default_delimiter=''): delimiter = self.get('delimiter', default_delimiter) try: text = reduce(lambda a, b: a + delimiter + b, filter(lambda s: s is not None, strings)) except: text = String('') return text class Displayed(object): pass class Quoted(object): def quote(self, string): piq = self.get_locale_option('punctuation-in-quote').lower() == 'true' if self.get('quotes', 'false').lower() == 'true': open_quote = self.get_term('open-quote').single close_quote = self.get_term('close-quote').single string = open_quote + string + close_quote ## quoted_string = QuotedString(string, open_quote, close_quote, piq) return string class StrippedPeriods(object): def strip_periods(self, string): strip_periods = self.get('strip-periods', 'false').lower() == 'true' if strip_periods: string = string.replace('.', '') return string class TextCased(object): _stop_words = ['a', 'an', 'and', 'as', 'at', 'but', 'by', 'down', 'for', 'from', 'in', 'into', 'nor', 'of', 'on', 'onto', 'or', 'over', 'so', 'the', 'till', 'to', 'up', 'via', 'with', 'yet'] def case(self, text, language=None): text_case = self.get('text-case') if text_case is not None: if language != 'en' and text_case == 'title': text_case = 'sentence' if text_case == 'lowercase': text = text.lower() elif text_case == 'uppercase': text = text.upper() elif text_case == 'capitalize-first': text = text.capitalize_first() elif text_case == 'capitalize-all': output = [] for word in text.words(): word = word.capitalize_first() output.append(word) text = ' '.join(output) elif text_case == 'title': output = [] prev = ':' for word in text.words(): if not text.isupper() and not word.isupper(): word = word.soft_lower() if (str(word) not in self._stop_words or prev in (':', '.')): word = word.capitalize_first() prev = word[-1] output.append(word) text = ' '.join(output) elif text_case == 'sentence': output = [] for i, word in enumerate(text.words()): if not text.isupper() and not word.isupper(): word = word.soft_lower() if i == 0: word = word.capitalize_first() output.append(word) text = ' '.join(output) return text # Locale elements class Term(CitationStylesElement): @property def single(self): try: text = self.find('cs:single', self.nsmap).text except AttributeError: text = self.text text = self.preformat(text or '') return String(text) @property def multiple(self): try: text = self.find('cs:multiple', self.nsmap).text except AttributeError: text = self.text text = self.preformat(text or '') return String(text) # Sorting elements class Sort(CitationStylesElement): def sort(self, items, context): # custom sort function to push items with None keys to bottom def multi_key_sort(items, keys, descending): lst = zip(items, *keys) comparers = [(itemgetter(i + 1), descending[i]) for i in range(len(keys))] def mycmp(left, right): for getter, desc in comparers: left_key, right_key = getter(left), getter(right) if left_key is not None and right_key is not None: try: left_key = str(left_key.lower()) right_key = str(right_key.lower()) except AttributeError: pass try: left_key, right_key = (int(str(left_key)), int(str(right_key))) except ValueError: pass result = (left_key > right_key) - (left_key < right_key) if result: return -1 * result if desc else result elif left_key is not None: return -1 elif right_key is not None: return 1 else: continue else: return 0 sorted_lst = sorted(lst, key=cmp_to_key(mycmp)) return [item[0] for item in sorted_lst] sort_descending = [] sort_keys = [] for key in self.findall('cs:key', self.nsmap): descending = key.get('sort', 'ascending').lower() == 'descending' sort_descending.append(descending) sort_keys.append(key.sort_keys(items, context)) return multi_key_sort(items, sort_keys, sort_descending) class Key(CitationStylesElement): def sort_keys(self, items, context): if 'variable' in self.attrib: variable = self.get('variable').replace('-', '_') if variable in NAMES: sort_keys = [self._format_name(item, variable) for item in items] elif variable in DATES: sort_keys = [] for item in items: date = item.reference.get(variable) if date is not None: sort_keys.append(date.sort_key()) else: sort_keys.append(None) elif variable in NUMBERS: sort_keys = [self._format_number(item, variable) for item in items] elif variable == 'citation_number': sort_keys = [item.number for item in items] else: sort_keys = [item.get_field(variable) for item in items] elif 'macro' in self.attrib: layout = context.get_layout() # override name options sort_options = {'name-as-sort-order': 'all'} for option in ('names-min', 'names-use-first', 'names-use-last'): if option in self.attrib: name = option.replace('names', 'et-al') sort_options[name] = self.get(option) macro = self.get_macro(self.get('macro')) sort_keys = [] for item in items: layout.repressed = {} sort_key = macro.render(item, context=context, sort_options=sort_options) sort_keys.append(sort_key) return sort_keys def _format_name(self, item, variable): names = item.reference.get(variable) if names is not None: output = [] for name in names: demote_ndp = self.get_root().get('demote-non-dropping-particle', 'display-and-sort').lower() sort_separator = self._default_options['sort-separator'] # TODO: encapsulate in function (to share with Name) given, family, dp, ndp, suffix = name.parts() if demote_ndp in ('sort-only', 'display-and-sort'): given = ' '.join([n for n in (given, dp, ndp) if n]) else: family = ' '.join([n for n in (ndp, family) if n]) given = ' '.join([n for n in (given, dp) if n]) order = family, given, suffix output.append(sort_separator.join([n for n in order if n])) return ';'.join(output) else: return None def _format_number(self, item, variable): date = item.reference.get(variable) if date is not None: try: return str(Number.re_numeric.match(date).group(1)) except AttributeError: return date else: return None # Rendering elements class Parent(object): def calls_variable(self): return any([child.calls_variable() for child in self.getchildren()]) def process_children(self, item, **kwargs): output = [] for child in self.iterchildren(): try: text = child.process(item, **kwargs) if text is not None: output.append(text) except VariableError: pass if output: return ''.join(output) else: return None def render_children(self, item, **kwargs): output = [] for child in self.iterchildren(): try: text = child.render(item, **kwargs) if text is not None: output.append(text) except VariableError: pass if output: return reduce(lambda a, b: a + b, output) else: return None class Macro(CitationStylesElement, Parent): def process(self, item, context=None, sort_options=None): return self.process_children(item, context=context, sort_options=sort_options) def render(self, item, context=None, sort_options=None): return self.render_children(item, context=context, sort_options=sort_options) class Layout(CitationStylesElement, Parent, Formatted, Affixed, Delimited): def render_citation(self, citation, callback): # first sort citation items according to bibliography order bibliography = citation.bibliography good_cites = [cite for cite in citation.cites if not cite.is_bad()] bad_cites = [cite for cite in citation.cites if cite.is_bad()] good_cites.sort(key=lambda item: bibliography.keys.index(item.key)) # sort using citation/sort element if self.getparent().sort is not None: good_cites = self.getparent().sort.sort(good_cites, self) out = [] for item in good_cites: self.repressed = {} prefix = item.get('prefix', '') suffix = item.get('suffix', '') try: output = self.render_children(item) if output is not None: text = prefix + output + suffix out.append(text) self.getparent().cites.append(item) except VariableError: pass for item in bad_cites: callback_value = callback(item) out.append(callback_value or '{}?'.format(item.key)) return self.format(self.wrap(self.join(out))) def sort_bibliography(self, citation_items): sort = self.getparent().find('cs:sort', self.nsmap) if sort is not None: citation_items = sort.sort(citation_items, self) return citation_items def render_bibliography(self, citation_items): output_items = [] for item in citation_items: self.repressed = {} text = self.format(self.wrap(self.render_children(item))) if text is not None: output_items.append(text) return output_items class Text(CitationStylesElement, Formatted, Affixed, Quoted, TextCased, StrippedPeriods): generated_variables = ('year-suffix', 'citation-number') def calls_variable(self): if 'variable' in self.attrib: return self.get('variable') not in self.generated_variables elif 'macro' in self.attrib: return self.get_macro(self.get('macro')).calls_variable() else: return False def render(self, *args, **kwargs): text, language = self.process(*args, **kwargs) return self.markup(text, language) def process(self, item, context=None, **kwargs): if context is None: context = self try: language = item.reference.language[:2] except VariableError: language = self.get_root().get('default-locale', 'en')[:2] if 'variable' in self.attrib: text = self._variable(item, context) elif 'macro' in self.attrib: text = self.get_macro(self.get('macro')).render(item, context) elif 'term' in self.attrib: text = self._term(item) elif 'value' in self.attrib: text = String(self.preformat(self.get('value'))) return text, language def _variable(self, item, context): variable = self.get('variable') repressed = context.get_layout().repressed if self.tag in repressed and variable in repressed[self.tag]: return None if self.get('form') == 'short': short_variable = variable + '-short' if short_variable.replace('-', '_') in item.reference: variable = short_variable if variable == 'page': text = self._page(item, context) elif variable == 'citation-number': text = item.number elif variable == 'locator': en_dash = self.unicode_character('EN DASH') text = str(item.locator.identifier).replace('-', en_dash) elif variable == 'page-first': text = str(item.reference.page.first) else: text = item.reference[variable.replace('-', '_')] return text def _page(self, item, context): page = item.reference.page str_first = str(page.first) text = str_first if 'last' in page: str_last = str(page.last) text += self.unicode_character('EN DASH') if len(str_first) != len(str_last): text += str_last else: range_fmt = self.get_root().get_option('page-range-format') text += self._page_format_last(str_first, str_last, range_fmt) return text @staticmethod def _page_format_last(first, last, range_format): def find_common(first, last): for count, (f, l) in enumerate(zip(first, last)): if f != l: return count return count + 1 common = find_common(first, last) if range_format == 'chicago': m = re.search('\d+', first) first_number = int(m.group()) if first_number < 100 or first_number % 100 == 0: range_format = 'expanded' elif len(first) >= 4 and common < 2: range_format = 'expanded' elif first_number % 100 in range(1, 10): range_format = 'minimal' elif first_number % 100 in range(10, 100): range_format = 'minimal-two' if range_format in ('expanded', None): index = 0 elif range_format == 'minimal': index = common elif range_format == 'minimal-two': index = min(common, len(first) - 2) return last[index:] def _term(self, item): form = self.get('form', 'long') plural = self.get('plural', 'false').lower() == 'true' if form == 'long': form = None term = self.get_term(self.get('term'), form) if plural: text = term.multiple else: text = term.single return text def markup(self, text, language): if text: tmp = self.format(self.case(self.strip_periods(text), language)) return self.wrap(self.quote(tmp)) else: return None class Date(CitationStylesElement, Parent, Formatted, Affixed, Delimited): def calls_variable(self): return True def is_locale_date(self): expr = './ancestor::cs:locale[1]' try: self.xpath_search(expr)[0] return True except IndexError: return False def render_single_date(self, date, show_parts=None, context=None): form = self.get('form') if context != self: parts = self.parts(date, show_parts, context) else: parts = self.parts(date, show_parts) if parts: style_context = context if self.is_locale_date() else self return style_context.join(parts) else: return None def render_date_range(self, date_range, show_parts=None, context=None): same_show_parts = [] if date_range.end.is_nil(): same = None diff_begin = self.render_single_date(date_range.begin, show_parts, context) diff_end = '' else: if date_range.begin.year == date_range.end.year: show_parts.remove('year') same_show_parts.append('year') try: if ('month' in show_parts and date_range.begin.month == date_range.end.month): show_parts.remove('month') same_show_parts.append('month') try: if ('day' in show_parts and date_range.begin.day == date_range.end.day): show_parts.remove('day') same_show_parts.append('day') except AttributeError: show_parts.remove('day') except AttributeError: show_parts.remove('month') same = self.render_single_date(date_range.end, same_show_parts, context) diff_begin = self.render_single_date(date_range.begin, show_parts, context) diff_end = self.render_single_date(date_range.end, show_parts, context) if not (diff_begin and diff_begin): return None diff = (diff_begin.rstrip() + self.unicode_character('EN DASH') + diff_end) if same: text = context.join([diff, same.rstrip()]) else: text = diff return text def process(self, item, variable=None, show_parts=None, context=None, **kwargs): if variable is None: variable = self.get('variable') if show_parts is None: show_parts = ['year', 'month', 'day'] if context is None: context = self form = self.get('form') date_parts = self.get('date-parts') if not self.is_locale_date() and form is not None: localized_date = self.get_date(form) if date_parts is not None: show_parts = date_parts.split('-') return localized_date.render(item, variable, show_parts=show_parts, context=self) else: date_or_range = item.reference[variable.replace('-', '_')] if not date_or_range: text = None elif isinstance(date_or_range, LiteralDate): text = date_or_range.text elif isinstance(date_or_range, DateRange): text = self.render_date_range(date_or_range, show_parts, context) else: text = self.render_single_date(date_or_range, show_parts, context) if text is not None: style_context = context if self.is_locale_date() else self return style_context.wrap(text) else: return None def parts(self, date, show_parts, context=None): output = [] for part in self.iterchildren(): if part.get('name') in show_parts: try: part_text = part.render(date, context) if part_text is not None: output.append(part_text) except VariableError: pass return output def markup(self, text): # TODO: fix return text class Date_Part(CitationStylesElement, Formatted, Affixed, TextCased, StrippedPeriods): def process(self, date, context=None): name = self.get('name') range_delimiter = self.get('range-delimiter', '-') attrib = self.attrib if context is None: context = self try: expr = './cs:date-part[@name="{}"]'.format(name) attrib.update(dict(context.xpath_search(expr)[0].attrib)) except (AttributeError, IndexError): pass if name == 'day': form = self.get('form', 'numeric') if (form == 'ordinal' and self.get_locale_option('limit-day-ordinals-to-day-1') .lower() == 'true' and date.day > 1): form = 'numeric' if form == 'numeric': text = date.day elif form == 'numeric-leading-zeros': text = '{:02}'.format(date.day) elif form == 'ordinal': text = to_ordinal(date.day, context) elif name == 'month': form = self.get('form', 'long') strip_periods = self.get('form', False) try: index = date.month term = 'month' except VariableError: index = date.season term = 'season' if form == 'long': text = context.get_term('{}-{:02}'.format(term, index)).single elif form == 'short': term = context.get_term('{}-{:02}'.format(term, index), 'short') text = term.single else: assert term == 'month' if form == 'numeric': text = '{}'.format(index) elif form == 'numeric-leading-zeros': text = '{:02}'.format(index) elif name == 'year': form = self.get('form', 'long') if form == 'long': text = str(abs(date.year)) if date.year < 0: text += context.get_term('bc').single elif date.year < 1000: text += context.get_term('ad').single elif form == 'short': text = str(date.year)[-2:] return text def markup(self, text): if text: return self.wrap(self.format(self.case(self.strip_periods(text)))) else: return None class Number(CitationStylesElement, Formatted, Affixed, Displayed, TextCased, StrippedPeriods): re_numeric = re.compile(r'^(\d+).*') re_range = re.compile(r'^(\d+)\s*-\s*(\d+)$') def calls_variable(self): return True def process(self, item, context=None, **kwargs): form = self.get('form', 'numeric') variable = self.get('variable') if variable == 'locator': try: variable = item.locator.identifier except KeyError: return None elif variable == 'page-first': variable = item.reference.page.first else: variable = item.reference[variable] try: first, last = map(int, self.re_range.match(str(variable)).groups()) first = self.format_number(first, form) last = self.format_number(last, form) text = first + self.unicode_character('EN DASH') + last except AttributeError: try: number = int(self.re_numeric.match(str(variable)).group(1)) text = self.format_number(number, form) except AttributeError: text = variable except TypeError: text = str(variable) return text def format_number(self, number, form): if form == 'numeric': text = str(number) elif form == 'ordinal' or form == 'long-ordinal' and number > 10: text = to_ordinal(number, self) elif form == 'long-ordinal': text = self.get_term('long-ordinal-{:02}'.format(number)).single elif form == 'roman': text = romanize(number).lower() return text def markup(self, text): if text: return self.wrap(self.format(self.case(self.strip_periods(text)))) else: return None class Names(CitationStylesElement, Parent, Formatted, Affixed, Delimited): def calls_variable(self): return True def get_parent_delimiter(self, context=None): expr = './ancestor::*[self::cs:citation or self::cs:bibliography][1]' if context is None: context = self parent = context.xpath_search(expr)[0] return parent.get_option('names-delimiter') def substitute(self): expr = './cs:substitute[1]' try: result = self.xpath_search(expr)[0] except IndexError: result = None return result def process(self, item, names_context=None, context=None, **kwargs): if context is None: context = self if names_context is None: names_context = self roles = self.get('variable').split() try: ed_trans = (set(roles) == set(['editor', 'translator']) and item.reference.editor == item.reference.translator and self.get_term('editortranslator').getchildren()) if ed_trans: roles = ['editor'] except VariableError: ed_trans = False output = [] for role in roles: if role in item.reference: name_elem = names_context.name if name_elem is None: name_elem = Name() names_context.insert(0, name_elem) text = name_elem.render(item, role, context=context, **kwargs) plural = len(item.reference[role]) > 1 try: if ed_trans: role = 'editortranslator' label_element = names_context.label label = label_element.render(item, role, plural, **kwargs) if label is not None: if label_element is names_context.getchildren()[0]: text = label + text else: text = text + label except AttributeError: pass output.append(text) if output: try: total = sum(output) except TypeError: is_int = False else: is_int = isinstance(total, int) if is_int: text = str(total) if total > 0 else None else: text = self.join(output, self.get_parent_delimiter(context)) else: substitute = self.substitute() if substitute is not None: text = substitute.render(item, context=context, **kwargs) try: return text except NameError: raise VariableError def markup(self, text): if text: return self.wrap(self.format(text)) else: return None class Name(CitationStylesElement, Formatted, Affixed, Delimited): def get_option(self, name, context=None, sort_options=None): try: value = sort_options[name] except (TypeError, KeyError): expr = ('./ancestor::*[self::cs:citation or ' 'self::cs:bibliography][1]') if context is None: context = self parent = context.xpath_search(expr)[0] if name in ('form', 'delimiter'): value = self.get(name, parent.get_option('name-' + name)) else: value = self.get(name, parent.get_option(name)) if name in ('initialize-with-hyphen', 'et-al-use-last'): value = value.lower() == 'true' elif name.startswith('et-al'): value = int(value) return value def et_al(self): expr = './following-sibling::cs:et-al[1]' try: result = self.xpath_search(expr)[0].render() except IndexError: result = self.get_term('et-al').single return result def process(self, item, variable, context=None, sort_options=None, **kwargs): def get_option(name): return self.get_option(name, context, sort_options) and_ = get_option('and') delimiter = get_option('delimiter') delimiter_precedes_et_al = get_option('delimiter-precedes-et-al') delimiter_precedes_last = get_option('delimiter-precedes-last') et_al_min = get_option('et-al-min') et_al_use_first = get_option('et-al-use-first') et_al_subseq_min = get_option('et-al-subsequent-min') et_al_subseq_use_first = get_option('et-al-subsequent-use-first') et_al_use_last = get_option('et-al-use-last') initialize_with = get_option('initialize-with') name_as_sort_order = get_option('name-as-sort-order') sort_separator = get_option('sort-separator') form = get_option('form') demote_ndp = get_option('demote-non-dropping-particle') def format_name_parts(given, family): for part in self.findall('cs:name-part', self.nsmap): given, family = part.format_part(given, family) return given, family names = item.reference.get(variable, []) if and_ == 'text': and_term = self.get_term('and').single elif and_ == 'symbol': and_term = self.preformat('&') et_al = self.et_al() output = [] if form == 'count': count = min(len(names), et_al_use_first) output.append(count) return sum(output) else: et_al_truncate = (len(names) > 1 and et_al_min and len(names) >= et_al_min) et_al_last = et_al_use_last and et_al_use_first <= et_al_min - 2 if et_al_truncate: if et_al_last: names = names[:et_al_use_first] + [names[-1]] else: names = names[:et_al_use_first] for i, name in enumerate(names): given, family, dp, ndp, suffix = name.parts() if given is not None and initialize_with is not None: given = self.initialize(given, initialize_with, context) if form == 'long': if (name_as_sort_order == 'all' or (name_as_sort_order == 'first' and i == 0)): if demote_ndp in ('never', 'sort-only'): family = ' '.join([n for n in (ndp, family) if n]) given = ' '.join([n for n in (given, dp) if n]) else: given = ' '.join([n for n in (given, dp, ndp) if n]) given, family = format_name_parts(given, family) order = family, given, suffix text = sort_separator.join([n for n in order if n]) else: family = ' '.join([n for n in (dp, ndp, family) if n]) given, family = format_name_parts(given, family) order = given, family, suffix text = ' '.join([n for n in order if n]) elif form == 'short': family = ' '.join([n for n in (ndp, family) if n]) given, family = format_name_parts(given, family) text = family output.append(text) if et_al_truncate and et_al: if et_al_last: ellipsis = self.unicode_character('horizontal ellipsis') output[-1] = ellipsis + ' ' + output[-1] text = self.join(output, delimiter) elif (delimiter_precedes_et_al == 'always' or (delimiter_precedes_et_al == 'contextual' and len(output) >= 2)): output.append(et_al) text = self.join(output, delimiter) else: text = self.join(output, delimiter) + ' ' + et_al elif and_ is not None and len(output) > 1: text = self.join(output[:-1], ', ') if (delimiter_precedes_last == 'always' or (delimiter_precedes_last == 'contextual' and len(output) > 2)): text = self.join([text, '']) else: text += ' ' text += '{} '.format(and_term) + output[-1] else: text = self.join(output, delimiter) return text def initialize(self, given, mark, context): if self.get_option('initialize-with-hyphen', context): hyphen_parts = given.split('-') else: hyphen_parts = [given.replace('-', ' ')] result_parts = [] for hyphen_part in hyphen_parts: parts = hyphen_part.replace('.', ' ').split() hyphen_result = '' group = [] for part in parts: if part[0].isupper(): group.append(part[0]) else: # don't initialize particles (which aren't capitalized) hyphen_result += mark.join(group) + mark + ' ' + part + ' ' group = [] hyphen_result += mark.join(group) + mark # remove double spaces hyphen_result = ' '.join(hyphen_result.split()) result_parts.append(hyphen_result) return '-'.join(result_parts) def markup(self, text): if text: return self.wrap(self.format(text)) else: return None class Name_Part(CitationStylesElement, Formatted, Affixed, TextCased): def format_part(self, given, family): if self.get('name') == 'given': given = self.wrap(self.format(self.case(given))) elif self.get('name') == 'family': family = self.wrap(self.format(self.case(family))) return given, family class Et_Al(CitationStylesElement, Formatted, Affixed): def process(self): variable = self.get('term', 'et-al') term = self.get_term('variable') return term def markup(self, text): if text: return self.wrap(self.format(text)) else: return None class Substitute(CitationStylesElement, Parent): def render(self, item, context=None, **kwargs): for child in self.getchildren(): try: if isinstance(child, Names) and child.name is None: names = self.xpath_search('./parent::cs:names[1]')[0] text = child.render(item, names_context=names, context=context, **kwargs) else: text = child.render(item, context=context, **kwargs) except VariableError: continue if text: self.add_to_repressed_list(child, context) break try: return text except NameError: return None def add_to_repressed_list(self, child, context): layout = context.get_layout() tag_list = layout.repressed.get(child.tag, []) tag_list.append(child.get('variable')) layout.repressed[child.tag] = tag_list class Label(CitationStylesElement, Formatted, Affixed, StrippedPeriods, TextCased): def calls_variable(self): return self.get('variable') == 'locator' def process(self, item, variable=None, plural=None, context=None, **kwargs): if variable is None: variable = self.get('variable') form = self.get('form', 'long') plural_option = self.get('plural', 'contextual') if plural is None: plural = self._is_plural(item) if variable == 'locator' and item.has_locator: variable = item.locator.label if form == 'long': term = self.get_term(variable) else: term = self.get_term(variable, form) if (plural_option == 'contextual' and plural or plural_option == 'always'): text = term.multiple else: text = term.single return text def markup(self, text): if text: return self.wrap(self.format(self.case(self.strip_periods(text)))) else: return None RE_MULTIPLE_NUMBERS = re.compile(r'\d+[^\d]+\d+') def _is_plural(self, item): variable = self.get('variable') if variable == 'locator': value = item.locator.identifier else: try: value = item.reference[variable.replace('-', '_')] except VariableError: return False if variable.startswith('number-of') and int(item[variable]) > 1: return True else: return self.RE_MULTIPLE_NUMBERS.search(str(value)) is not None class Group(CitationStylesElement, Parent, Formatted, Affixed, Delimited): def calls_variable(self): return True def process(self, item, context=None, **kwargs): output = [] variable_called = False variable_rendered = False for child in self.iterchildren(): variable_called = variable_called or child.calls_variable() try: child_text = child.render(item, context=context, **kwargs) if child_text is not None: output.append(child_text) variable_rendered = (variable_rendered or child.calls_variable()) except VariableError: pass output = [item for item in output if item is not None] success = not variable_called or (variable_called and variable_rendered) if output and success: return self.join(output) else: raise VariableError def markup(self, text): if text: return self.wrap(self.format(text)) else: return None class ConditionFailed(Exception): pass class Choose(CitationStylesElement, Parent): def render(self, item, context=None, **kwargs): for child in self.getchildren(): try: return child.render(item, context=context, **kwargs) except ConditionFailed: continue return None class If(CitationStylesElement, Parent): def render(self, item, context=None, **kwargs): # TODO self.get('disambiguate') results = [] if 'type' in self.attrib: results += self._type(item) if 'variable' in self.attrib: results += self._variable(item) if 'is-numeric' in self.attrib: results += self._is_numeric(item) if 'is-uncertain-date' in self.attrib: results += self._is_uncertain_date(item) if 'locator' in self.attrib: results += self._locator(item) if 'position' in self.attrib: results += self._position(item, context) # TODO: 'match' also applies to individual tests above! if self.get('match') == 'any': result = any(results) elif self.get('match') == 'none': result = not any(results) else: result = all(results) if not result: raise ConditionFailed return self.render_children(item, context=context, **kwargs) def _type(self, item): return [typ.lower() == item.reference.type for typ in self.get('type').split()] def _variable(self, item): variables = [var.replace('-', '_') for var in self.get('variable').split()] output = [] for variable in variables: if variable == 'locator': output.append('locator' in item) else: output.append(variable in item.reference) return output def _is_numeric(self, item): numeric_match = Number.re_numeric.match return [var.replace('-', '_') in item.reference and numeric_match(str(item.reference[var.replace('-', '_')])) for var in self.get('is-numeric').split()] def _is_uncertain_date(self, item): result = [] for date in self.get('is-uncertain-date').split(): date_variable = date.replace('-', '_') try: circa = item.reference[date_variable].get('circa', False) except VariableError: circa = False result.append(circa) return result def _locator(self, item): return [var.replace('-', ' ') == item.locator.label for var in self.get('locator').split()] def _position(self, item, context): if context is None: context = self if context.xpath_search('./ancestor::*[self::cs:bibliography]'): return [False] # citation node cites = context.get_layout().getparent().cites last_cite = cites[-1] if cites else None already_cited = item.key in (cite.key for cite in cites) possibly_ibid = (already_cited and item.key == last_cite.key and (item.citation is last_cite.citation or len(last_cite.citation.cites) == 1)) results = [] for position in self.get('position').split(): result = False if position == 'first': result = not already_cited elif position == 'subsequent': result = already_cited elif possibly_ibid and position == 'ibid': result = item.has_locator or not last_cite.has_locator elif possibly_ibid and position == 'ibid-with-locator': result = (item.has_locator and not last_cite.has_locator or (item.has_locator and last_cite.has_locator and item.locator != last_cite.locator)) elif already_cited and position == 'near-note': max_distance = self.get_root().get_option('near-note-distance') citations = 1 last_citation = None for cite in reversed(cites): if item.key == cite.key and citations <= max_distance: result = True break elif cite.citation is not last_citation: citations += 1 last_citation = cite.citation results.append(result) return results class Else_If(If, CitationStylesElement): pass class Else(CitationStylesElement, Parent): def render(self, item, context=None, **kwargs): return self.render_children(item, context=context, **kwargs) # utility functions def to_ordinal(number, context): number = str(number) last_digit = int(number[-1]) if last_digit in (1, 2, 3) and not (len(number) > 1 and number[-2] == '1'): ordinal_term = 'ordinal-{:02}'.format(last_digit) else: ordinal_term = 'ordinal-04' return number + context.get_term(ordinal_term).single def romanize(n): # by Kay Schluehr - from http://billmill.org/python_roman.html numerals = (('M', 1000), ('CM', 900), ('D', 500), ('CD', 400), ('C', 100),('XC', 90),('L', 50),('XL', 40), ('X', 10), ('IX', 9), ('V', 5), ('IV', 4), ('I', 1)) roman = [] for ltr, num in numerals: (k, n) = divmod(n, num) roman.append(ltr * k) return ''.join(roman) citeproc-py-0.3.0/citeproc/py2compat.py0000644000076500000240000000120612375162470020625 0ustar brechtmstaff00000000000000 from __future__ import (absolute_import, division, print_function, unicode_literals) import locale import sys __all__ = ['PY2'] PY2 = sys.version_info < (3, 0) if PY2: __all__ += ['str', 'print', 'open'] from io import open str = unicode std_print = print def print(*objects, **kwargs): if kwargs.get('file', sys.stdout) == sys.stdout: objects = (unicode(obj) for obj in objects) if not sys.stdout.encoding: objects = (obj.encode(locale.getpreferredencoding()) for obj in objects) std_print(*objects, **kwargs) citeproc-py-0.3.0/citeproc/source/0000755000076500000240000000000012427163401017627 5ustar brechtmstaff00000000000000citeproc-py-0.3.0/citeproc/source/__init__.py0000644000076500000240000001370712377730476021770 0ustar brechtmstaff00000000000000 from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * # http://sourceforge.net/mailarchive/message.php?msg_id=25355232 # http://dret.net/bibconvert/tex2unicode from warnings import warn from .. import VARIABLES class CustomDict(dict): def __init__(self, args, required=set(), optional=set(), required_or=[]): passed_keywords = set(args.keys()) missing = required - passed_keywords if missing: raise TypeError('The following required arguments are missing: ' + ', '.join(missing)) required_or_merged = set() for required_options in required_or: if not passed_keywords & required_options: raise TypeError('Require at least one of: ' + ', '.join(required_options)) required_or_merged |= required_options unsupported = passed_keywords - required - optional - required_or_merged if unsupported: cls_name = self.__class__.__name__ warn('The following arguments for {} are '.format(cls_name) + 'unsupported: ' + ', '.join(unsupported)) self.update(args) def __setattr__(self, name, value): self[name] = value def __getattr__(self, name): return self[name] def __getitem__(self, key): try: return super(CustomDict, self).__getitem__(key) except KeyError: raise VariableError class Reference(CustomDict): def __init__(self, key, type, **args): self.key = key self.type = type #required_or = [set(csl.VARIABLES)] optional = ({'uri', 'container_uri', 'contributor', 'date'} | set(VARIABLES)) super(Reference, self).__init__(args, optional=optional) def __repr__(self): return '{}({})'.format(self.__class__.__name__, self.key) class VariableError(Exception): pass class Name(CustomDict): def __init__(self, **args): if 'name' in args: required = {'name'} optional = set() else: required = {'family'} optional = {'given', 'dropping-particle', 'non-dropping-particle', 'suffix'} super(Name, self).__init__(args, required, optional) def parts(self): return (self.get('given'), self.get('family'), self.get('dropping-particle'), self.get('non-dropping-particle'), self.get('suffix')) class DateBase(CustomDict): def __init__(self, args, required=set(), optional=set()): optional = {'circa'} | optional super(DateBase, self).__init__(args, required, optional) # defaults if 'circa' not in self: self['circa'] = False class Date(DateBase): def __init__(self, **args): required = {'year'} optional = {'month', 'day', 'season'} if 'day' in args and 'month' not in args: raise TypeError('When specifying the day, you should also specify ' 'the month') args = {key: int(value) for key, value in args.items()} super(Date, self).__init__(args, required, optional) def sort_key(self): year = self.year month = self.get('month', 0) day = self.get('day', 0) return '{:05}{:02}{:02}'.format(year + 10000, month, day) def is_nil(self): return (self.year == 0 and self.get('month', 0) == 0 and self.get('day', 0) == 0) class LiteralDate(DateBase): def __init__(self, text, **args): self.text = text super(LiteralDate, self).__init__(args) def sort_key(self): return self.text class DateRange(DateBase): def __init__(self, **args): required = {'begin'} optional = {'end'} super(DateRange, self).__init__(args, required, optional) def sort_key(self): begin = self.begin.sort_key() end = self.get('end', Date(year=0)).sort_key() return begin + '-' + end def __eq__(self, other): # TODO: for sorting raise NotImplementedError class Pages(CustomDict): def __init__(self, **args): required = {'first'} optional = {'last'} for key, value in args.items(): try: args[key] = int(value) except ValueError: pass super(Pages, self).__init__(args, required, optional) class Citation(CustomDict): def __init__(self, cites, **kwargs): for cite in cites: cite.citation = self self.cites = cites super(Citation, self).__init__(kwargs) def __repr__(self): cites = ', '.join([cite.key for cite in self.cites]) return '{}({})'.format(self.__class__.__name__, cites) class CitationItem(CustomDict): def __init__(self, key, bibliography=None, **args): self.key = key.lower() optional = {'locator', 'prefix', 'suffix'} super(CitationItem, self).__init__(args, optional=optional) def __repr__(self): return '{}({})'.format(self.__class__.__name__, self.key) @property def bibliography(self): return self.citation.bibliography @property def reference(self): return self.bibliography.source[self.key] @property def number(self): return self.bibliography.keys.index(self.key) + 1 @property def has_locator(self): return 'locator' in self def get_field(self, field): string = self.reference.get(field) if string is not None: return self.bibliography.formatter.preformat(string) def is_bad(self): return self.key not in self.bibliography.keys class Locator(object): def __init__(self, label, identifier): self.label = label self.identifier = identifier class BibliographySource(dict): def add(self, entry): self[entry.key] = entry from . import bibtex, json citeproc-py-0.3.0/citeproc/source/bibtex/0000755000076500000240000000000012427163401021104 5ustar brechtmstaff00000000000000citeproc-py-0.3.0/citeproc/source/bibtex/__init__.py0000644000076500000240000000025412425507565023231 0ustar brechtmstaff00000000000000 from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * from .bibtex import BibTeX citeproc-py-0.3.0/citeproc/source/bibtex/bibparse.py0000644000076500000240000001345012426250721023251 0ustar brechtmstaff00000000000000 from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * # http://maverick.inria.fr/~Xavier.Decoret/resources/xdkbibtex/bibtex_summary.html # http://www.lsv.ens-cachan.fr/~markey/bibla.php?lang=en class BibTeXEntry(dict): def __init__(self, document_type, attributes): super(BibTeXEntry, self).__init__(attributes) self.document_type = document_type class BibTeXParser(dict): standard_variables = {'jan': 'January', 'feb': 'February', 'mar': 'March', 'apr': 'April', 'may': 'May', 'jun': 'June', 'jul': 'July', 'aug': 'August', 'sep': 'September', 'oct': 'October', 'nov': 'November', 'dec': 'December'} def __init__(self, file_or_filename): try: self.file = open(file_or_filename, 'rt', encoding='ascii') except TypeError: self.file = file_or_filename self.variables = {} self.preamble = '' self._parse(self.file) self.file.close() def _parse(self, file): while True: try: entry = self._parse_entry(file) if entry is not None: entry_type, key, attributes = entry self[key] = BibTeXEntry(entry_type, attributes) except EOFError: break def _parse_entry(self, file): while True: char = file.read(1) if char == '@': break elif char == '': raise EOFError entry_type = '' while True: char = file.read(1) if char in '{(': sentinel = '}' if char == '{' else ')' break entry_type += char if entry_type.lower().startswith('comment'): self._jump_to_next_line(file) return None entry_type = entry_type.strip().lower() if entry_type == 'string': name = self._parse_name(file) value = self._parse_value(file) self.variables[name] = value assert self._eat_whitespace(file) == sentinel return None elif entry_type == 'preamble': self.preamble += self._parse_value(file) assert self._eat_whitespace(file) == sentinel return None key = self._parse_key(file) entry = {} while True: name = self._parse_name(file) value = self._parse_value(file) entry[name] = value char = self._eat_whitespace(file) if char != ',': if char != sentinel: assert char in ' \t\n\r' assert self._eat_whitespace(file) == sentinel break else: restore_point = file.tell() if self._eat_whitespace(file) == sentinel: break file.seek(restore_point) return entry_type.strip().lower(), key, entry def _parse_key(self, file): key = '' char = file.read(1) while char != ',': key += char char = file.read(1) return key.strip().lower() def _parse_name(self, file): name = '' char = self._eat_whitespace(file) while True: if char == '=': break name += char char = file.read(1) return name.strip().lower() def _parse_value(self, file): char = self._eat_whitespace(file) if char in '{"': value = self._parse_string(file, char) elif char.isalpha(): value = self._parse_variable(file, char) else: value = self._parse_integer(file, char) restore_position = file.tell() char = self._eat_whitespace(file) if char == '#': value += self._parse_value(file) else: file.seek(restore_position) return value def _parse_string(self, file, opening_character): closing_character = '"' if opening_character == '"' else '}' string = '' depth = 0 while True: char = file.read(1) if char == '{': depth += 1 elif depth == 0 and char == closing_character: break elif char == '}': depth -= 1 string += char return string def _parse_variable(self, file, char): key = '' restore_point = file.tell() while char.isalnum() or char in '-_': key += char restore_point = file.tell() char = file.read(1) file.seek(restore_point) if key.lower() in self.variables: value = self.variables[key.lower()] else: value = self.standard_variables[key.lower()] return value def _parse_integer(self, file, char): integer = '' restore_point = file.tell() while char.isdigit(): integer += char restore_point = file.tell() char = file.read(1) file.seek(restore_point) return int(integer) # TODO: rename to next_token? def _eat_whitespace(self, file): char = file.read(1) while char in ' \t\n\r': char = file.read(1) return char def _jump_to_next_line(self, file): char = '' while char != '\n': restore_point = file.tell() char = file.read(1) file.seek(restore_point) def _split_name(self, name): pass citeproc-py-0.3.0/citeproc/source/bibtex/bibtex.py0000644000076500000240000002657712427163244022761 0ustar brechtmstaff00000000000000 from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * import re import unicodedata from warnings import warn from ...types import (ARTICLE, ARTICLE_JOURNAL, BOOK, CHAPTER, MANUSCRIPT, PAMPHLET, PAPER_CONFERENCE, REPORT, THESIS) from ...string import String, MixedString, NoCase from .. import BibliographySource, Reference, Name, Date, DateRange, Pages from .bibparse import BibTeXParser from .latex import parse_latex from .latex.macro import NewCommand, Macro class BibTeX(BibliographySource): fields = {'address': 'publisher_place', 'annote': 'annote', 'author': 'author', 'booktitle': 'container_title', 'chapter': 'chapter_number', 'edition': 'edition', 'editor': 'editor', # 'howpublished': None, # 'institution': None, 'journal': 'container_title', # 'month': None, 'note': 'note', 'number': 'issue', # 'organization': None, 'pages': 'page', 'publisher': 'publisher', # 'school': None, 'series': 'collection_title', 'title': 'title', # 'type': None, # 'year': None, 'volume': 'volume', # non-standard fields 'isbn': 'ISBN', 'issn': 'ISSN'} types = {'article': ARTICLE_JOURNAL, 'book': BOOK, 'booklet': PAMPHLET, 'conference': PAPER_CONFERENCE, 'inbook': CHAPTER, 'incollection': ARTICLE_JOURNAL, 'inproceedings': PAPER_CONFERENCE, 'manual': BOOK, 'mastersthesis': THESIS, 'misc': ARTICLE, 'phdthesis': THESIS, 'proceedings': BOOK, 'techreport': REPORT, 'unpublished': MANUSCRIPT} def __init__(self, filename): bibtex_database = BibTeXParser(filename) self.preamble_macros = {} parse_latex(bibtex_database.preamble, {'newcommand': NewCommand(self.preamble_macros), 'mbox': Macro(1, '{0}'), 'cite': Macro(1, 'CITE({0})')}) for key, entry in bibtex_database.items(): self.add(self.create_reference(key, entry)) def _bibtex_to_csl(self, bibtex_entry): csl_dict = {} for field, value in bibtex_entry.items(): try: csl_field = self.fields[field] except KeyError: if field not in ('year', 'month', 'filename'): warn("Unsupported BibTeX field '{}'".format(field)) continue if field in ('number', 'volume'): try: value = int(value) except ValueError: pass elif field == 'pages': if value.endswith('+'): value = Pages(first=int(value[:-1])) else: first, last = value.replace(' ', '').split('--') value = Pages(first=int(first), last=int(last)) elif field in ('author', 'editor'): value = [name for name in self._parse_author(value)] else: try: value = self._parse_string(value) except TypeError: value = str(value) csl_dict[csl_field] = value return csl_dict def _bibtex_to_csl_date(self, bibtex_entry): is_range = False if 'month' in bibtex_entry: begin_dict, end_dict = self._parse_month(bibtex_entry['month']) else: begin_dict, end_dict = {}, {} if 'year' in bibtex_entry: begin_dict['year'], end_dict['year'] \ = self._parse_year(bibtex_entry['year']) if not begin_dict: return None if begin_dict == end_dict: return Date(**begin_dict) else: return DateRange(begin=Date(**begin_dict), end=Date(**end_dict)) def _parse_year(self, year): try: year_str = parse_latex(year, self.preamble_macros) except TypeError: year_str = str(year) if EN_DASH in year_str: begin_year, end_year = year_str.split(EN_DASH) begin_len, end_len = len(begin_year), len(end_year) if end_len < begin_len: end_year = begin_year[:begin_len - end_len] + end_year else: begin_year = end_year = int(year_str) return begin_year, end_year months = ('jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec') def _parse_month(self, month): begin = {} end = {} month = month.strip() month = month.replace(', ', '-') if month.replace('-', '').isalpha(): if '-' in month: begin['month'], end['month'] = month.split('-') else: begin['month'] = end['month'] = month else: m = re.match('(?P\d+)[ ~]*(?P\w+)', month) begin['day'] = end['day'] = m.group('day') begin['month'] = end['month'] = m.group('month') begin['month'] = self.months.index(begin['month'][:3].lower()) end['month'] = self.months.index(end['month'][:3].lower()) return begin, end def _parse_string(self, title): def make_string(string, top_level_group=False): unlatexed = parse_latex(string, self.preamble_macros) fixed_case = top_level_group and not string.startswith('\\') string_cls = NoCase if fixed_case else String return string_cls(unlatexed) output = MixedString() level = 0 string = '' for char in title: if char == '{': if level == 0: if string: output += make_string(string) string = '' level += 1 elif char == '}': level -= 1 if level == 0: output += make_string(string, True) string = '' else: string += char if level != 0: raise SyntaxError('Non-matching braces in "{}"'.format(title)) if string: output += make_string(string) return output def _parse_author(self, authors): csl_authors = [] for author in split_names(authors): first, von, last, jr = parse_name(author) csl_parts = {} for part, csl_label in [(first, 'given'), (von, 'non-dropping-particle'), (last, 'family'), (jr, 'suffix')]: if part is not None: csl_parts[csl_label] = parse_latex(part, self.preamble_macros) name = Name(**csl_parts) csl_authors.append(name) return csl_authors def create_reference(self, key, bibtex_entry): csl_type = self.types[bibtex_entry.document_type] csl_fields = self._bibtex_to_csl(bibtex_entry) csl_date = self._bibtex_to_csl_date(bibtex_entry) if csl_date: csl_fields['issued'] = csl_date return Reference(key, csl_type, **csl_fields) # BibTeX name handling # # references # - BibTeXing by Oren Patashnik (Feb 8, 1988), 4. Helpful Hints, item 18 # (BibTeX 0.99d - http://www.ctan.org/tex-archive/biblio/bibtex/base/btxdoc.pdf) # - A summary of BibTex by Xavier Décoret # (http://maverick.inria.fr/~Xavier.Decoret/resources/xdkbibtex/bibtex_summary.html) # - Tame the BeaST by Nicolas Markey # (http://tug.ctan.org/info/bibtex/tamethebeast/ttb_en.pdf) AND = ' and ' def split_names(string): """Split a string of names separated by 'and' into a list of names.""" brace_level = 0 names = [] last_index = 0 for i in range(len(string)): char = string[i] if brace_level == 0 and string[i:].startswith(AND): names.append(string[last_index:i]) last_index = i + len(AND) elif char == '{': brace_level += 1 elif char == '}': brace_level -= 1 last_name = string[last_index:] if last_name: names.append(last_name) return names def parse_name(name): """Parse a BibTeX name string and split it into First, von, Last and Jr parts. """ parts = split_name(name) if len(parts) == 1: # First von Last first_von_last, = parts index = 0 first, jr = [], [] for word in first_von_last[:-1]: if is_capitalized(word) not in (True, None): break first.append(word) index += 1 von_last = first_von_last[index:] elif len(parts) == 2: # von Last, First jr = [] von_last, first = parts elif len(parts) == 3: # von Last, Jr, First von_last, jr, first = parts von, last = split_von_last(von_last) join = ' '.join return join(first) or None, join(von) or None, join(last), join(jr) or None def split_name(name): """Split a name in into parts delimited by commas (at brace-level 0), and each part into words. Returns a list of of lists of words. """ brace_level = 0 parts = [] current_part = [] word = '' for char in name: if char in ' \t,': if brace_level == 0: if word: current_part.append(word) word = '' if char == ',': parts.append(current_part) current_part = [] continue elif char == '{': brace_level += 1 elif char == '}': brace_level -= 1 word += char if word: current_part.append(word) parts.append(current_part) return parts def is_capitalized(string): """Check if a BibTeX substring is capitalized. A string can be "case-less", in which case `None` is returned. """ brace_level = 0 special_char = False for char, next_char in lookahead_iter(string): if (brace_level == 0 or special_char) and char.isalpha(): return char.isupper() elif char == '{': brace_level += 1 if brace_level == 1 and next_char == '\\': special_char = True elif char == '}': brace_level -= 1 if brace_level == 0: special_char = False return None # case-less def split_von_last(words): """Split "von Last" name into von and Last parts.""" if len(words) > 1 and is_capitalized(words[0]) is False: for j, word in enumerate(reversed(words[:-1])): if is_capitalized(word) not in (True, None): return words[:-j - 1], words[-j - 1:] return [], words def lookahead_iter(iterable): """Iterator that also yields the next item along with each item. The next item is `None` when yielding the last item. """ items = iter(iterable) item = next(items) for next_item in items: yield item, next_item item = next_item yield item, None EN_DASH = unicodedata.lookup('EN DASH') citeproc-py-0.3.0/citeproc/source/bibtex/latex/0000755000076500000240000000000012427163401022221 5ustar brechtmstaff00000000000000citeproc-py-0.3.0/citeproc/source/bibtex/latex/__init__.py0000644000076500000240000001125312426254400024333 0ustar brechtmstaff00000000000000 from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * import unicodedata from collections import namedtuple from warnings import warn __all__ = ['parse_latex', 'substitute_ligatures'] def parse_latex(string, macros={}): tokens = Tokenizer(string) output = '' for result in dispatch(tokens, macros): output += result return substitute_ligatures(output) Token = namedtuple('Token', ['type', 'value']) TOGGLE_MATH = 'TOGGLE-MATH' WHITESPACE = 'WHITESPACE' CLOSE_SCOPE = 'CLOSE-SCOPE' OPEN_SCOPE = 'OPEN-SCOPE' START_MACRO = 'START-MACRO' CHARACTER = 'CHARACTER' class Tokenizer(object): def __init__(self, string): self.string = string self._tokens = self.tokenize(string) self._next_token = None @staticmethod def tokenize(input_string): for char in input_string: if char == '\\': yield Token(START_MACRO, char) elif char == '{': yield Token(OPEN_SCOPE, char) elif char == '}': yield Token(CLOSE_SCOPE, char) elif char in ' \t\n': yield Token(WHITESPACE, char) elif char == '$': yield Token(TOGGLE_MATH, char) else: yield Token(CHARACTER, char) def __iter__(self): return self def __next__(self): if self._next_token: token = self._next_token self._next_token = None else: token = next(self._tokens) return token next = __next__ def peek(self): if self._next_token is None: self._next_token = next(self._tokens) return self._next_token def eat_whitespace(tokens): while tokens.peek().type == WHITESPACE: next(tokens) class ScopeClosing(Exception): pass def dispatch(tokens, macros, level=0): while True: try: next_token = tokens.peek() except StopIteration: if level > 0: warn("Unbalanced parenthesis in '{}'".format(tokens.string)) break if next_token.type == OPEN_SCOPE: yield handle_scope(tokens, macros, level) elif next_token.type == CLOSE_SCOPE: raise ScopeClosing elif next_token.type == START_MACRO: yield handle_macro(tokens, macros) elif next_token.type == TOGGLE_MATH: yield handle_math(tokens) else: assert next_token.type in (CHARACTER, WHITESPACE) yield next(tokens).value def handle_scope(tokens, macros, level): assert next(tokens).type == OPEN_SCOPE output = '' try: for result in dispatch(tokens, macros, level + 1): output += result except ScopeClosing: assert next(tokens).type == CLOSE_SCOPE return output def parse_argument(tokens, macros, level=0): eat_whitespace(tokens) return next(dispatch(tokens, macros, level)) def handle_macro(tokens, macros): assert next(tokens).type == START_MACRO name = parse_macro_name(tokens) try: macro = MACROS[name] except KeyError: macro = macros[name] return macro.parse_arguments_and_expand(tokens, macros) def parse_macro_name(tokens): token = next(tokens) assert token.type in (CHARACTER, TOGGLE_MATH, WHITESPACE) name = token.value if name.isalpha(): while tokens.peek().type == CHARACTER and tokens.peek().value.isalpha(): name += next(tokens).value eat_whitespace(tokens) return name def handle_math(tokens): assert next(tokens).type == TOGGLE_MATH output = '' for token in tokens: if token.type == START_MACRO: output += token.value token = next(tokens) elif token.type == TOGGLE_MATH: break output += token.value return '$' + output + '$' def substitute_ligatures(string): for chars, ligature in SUBSTITUTIONS.items(): string = string.replace(chars, unicodedata.lookup(ligature)) return string SUBSTITUTIONS = {"~": 'NO-BREAK SPACE', # ligatures defined in Computer Modern (symbol shortcuts) "--": 'EN DASH', "---": 'EM DASH', "''": 'RIGHT DOUBLE QUOTATION MARK', "``": 'LEFT DOUBLE QUOTATION MARK', "!`": 'INVERTED EXCLAMATION MARK', "?`": 'INVERTED QUESTION MARK', ",,": 'DOUBLE LOW-9 QUOTATION MARK', "<<": 'LEFT-POINTING DOUBLE ANGLE QUOTATION MARK', ">>": 'RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK', } from .macro import MACROS citeproc-py-0.3.0/citeproc/source/bibtex/latex/macro.py0000644000076500000240000001730712427154523023711 0ustar brechtmstaff00000000000000# coding: utf-8 from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * import unicodedata from . import (parse_argument, eat_whitespace, parse_macro_name, OPEN_SCOPE, CLOSE_SCOPE, START_MACRO) __all__ = ['MACROS', 'NewCommand', 'Macro'] class MacroBase(object): def parse_arguments(self, tokens): raise NotImplementedError def parse_arguments_and_expand(self, tokens): raise NotImplementedError class NewCommand(MacroBase): r""" \newcommand{cmd}[args]{def} """ def __init__(self, macros): self.macros = macros @staticmethod def _parse_macro_name(tokens): eat_whitespace(tokens) token = next(tokens) in_group = token.type == OPEN_SCOPE if in_group: eat_whitespace(tokens) token = next(tokens) assert token.type == START_MACRO name = parse_macro_name(tokens) if in_group: eat_whitespace(tokens) assert next(tokens).type == CLOSE_SCOPE return name @staticmethod def _parse_optional_arguments(tokens, macros): eat_whitespace(tokens) if tokens.peek().value == '[': next(tokens) num_args = '' for token in tokens: if token.value == ']': break num_args += token.value else: num_args = 0 return int(num_args) def parse_arguments_and_expand(self, tokens, macros): name = self._parse_macro_name(tokens) num_args = self._parse_optional_arguments(tokens, macros) definition = parse_argument(tokens, macros) for i in range(10): definition = definition.replace('#{}'.format(i + 1), '{' + str(i) + '}') self.macros[name] = Macro(num_args, definition) return '' class Macro(object): def __init__(self, num_args, format_string): self.num_args = num_args self.format_string = format_string def parse_arguments_and_expand(self, tokens, macros): args = [parse_argument(tokens, macros) for _ in range(self.num_args)] return self.expand(args) def expand(self, arguments): assert len(arguments) == self.num_args return self.format_string.format(*arguments) class Symbol(Macro): def __init__(self, symbol): super(Symbol, self).__init__(0, symbol) class SymbolByName(Macro): def __init__(self, unicode_symbol_name): unicode_symbol = unicodedata.lookup(unicode_symbol_name) super(SymbolByName, self).__init__(0, unicode_symbol) class Combining(Macro): def __init__(self, unicode_accent_name): unicode_accent = unicodedata.lookup('COMBINING ' + unicode_accent_name) super(Combining, self).__init__(1, '{0}' + unicode_accent) DOTTED_CHARS = {'ı': 'i', 'ȷ': 'j'} def expand(self, arguments): assert len(arguments) == self.num_args accented, rest = arguments[0][0], arguments[0][1:] accented = self.DOTTED_CHARS.get(accented, accented) expanded = super(Combining, self).expand([accented]) return unicodedata.normalize('NFC', expanded) + rest MACROS = { # accents '`': Combining('GRAVE ACCENT'), "'": Combining('ACUTE ACCENT'), '^': Combining('CIRCUMFLEX ACCENT'), '"': Combining('DIAERESIS'), 'H': Combining('DOUBLE ACUTE ACCENT'), '~': Combining('TILDE'), 'c': Combining('CEDILLA'), 'k': Combining('OGONEK'), '=': Combining('MACRON'), 'b': Combining('MACRON BELOW'), '.': Combining('DOT ABOVE'), 'd': Combining('DOT BELOW'), 'r': Combining('RING ABOVE'), 'u': Combining('BREVE'), 'v': Combining('CARON'), # '|': Combining('VERTICAL LINE ABOVE'), # 'h': Combining('HOOK ABOVE'), 'G': Combining('DOUBLE GRAVE ACCENT'), 'U': Combining('DOUBLE VERTICAL LINE ABOVE'), 't': Combining('DOUBLE INVERTED BREVE'), 'textcircled': Combining('ENCLOSING CIRCLE'), # symbols 'o': SymbolByName('LATIN SMALL LETTER O WITH STROKE'), 'O': SymbolByName('LATIN CAPITAL LETTER O WITH STROKE'), 'i': SymbolByName('LATIN SMALL LETTER DOTLESS I'), 'l': SymbolByName('LATIN SMALL LETTER L WITH STROKE'), 'L': SymbolByName('LATIN CAPITAL LETTER L WITH STROKE'), 'oe': SymbolByName('LATIN SMALL LIGATURE OE'), 'OE': SymbolByName('LATIN CAPITAL LIGATURE OE'), 'ae': SymbolByName('LATIN SMALL LETTER AE'), 'AE': SymbolByName('LATIN CAPITAL LETTER AE'), 'aa': SymbolByName('LATIN SMALL LETTER A WITH RING ABOVE'), 'AA': SymbolByName('LATIN CAPITAL LETTER A WITH RING ABOVE'), 'ss': SymbolByName('LATIN SMALL LETTER SHARP S'), 'dh': SymbolByName('LATIN SMALL LETTER ETH'), 'DH': SymbolByName('LATIN CAPITAL LETTER ETH'), 'dj': SymbolByName('LATIN SMALL LETTER D WITH STROKE'), 'DJ': SymbolByName('LATIN CAPITAL LETTER D WITH STROKE'), 'ng': SymbolByName('LATIN SMALL LETTER ENG'), 'NG': SymbolByName('LATIN CAPITAL LETTER ENG'), 'th': SymbolByName('LATIN SMALL LETTER THORN'), 'TH': SymbolByName('LATIN CAPITAL LETTER THORN'), 'dag': SymbolByName('DAGGER'), 'ddag': SymbolByName('DOUBLE DAGGER'), 'dots': SymbolByName('HORIZONTAL ELLIPSIS'), 'P': SymbolByName('PILCROW SIGN'), 'S': SymbolByName('SECTION SIGN'), 'copyright': SymbolByName('COPYRIGHT SIGN'), 'pounds': SymbolByName('POUND SIGN'), 'guillemotleft': SymbolByName('LEFT-POINTING DOUBLE ANGLE QUOTATION MARK'), 'guillemotright': SymbolByName('RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK'), 'guilsinglleft': SymbolByName('SINGLE LEFT-POINTING ANGLE QUOTATION MARK'), 'guilsinglright': SymbolByName('SINGLE RIGHT-POINTING ANGLE QUOTATION MARK'), 'quotedblbase': SymbolByName('DOUBLE LOW-9 QUOTATION MARK'), 'quotesinglbase': SymbolByName('SINGLE LOW-9 QUOTATION MARK'), 'textasciicircum': Symbol('^'), 'textasciitilde': Symbol('~'), 'textasteriskcentered': Symbol('*'), 'textbackslash': Symbol('\\'), 'textbar': Symbol('|'), 'textbraceleft': Symbol('{'), 'textbraceright': Symbol('}'), 'textbullet': SymbolByName('BULLET'), 'textcopyright': SymbolByName('COPYRIGHT SIGN'), 'textdagger': SymbolByName('DAGGER'), 'textdaggerdbl': SymbolByName('DOUBLE DAGGER'), 'textdollar': Symbol('$'), 'textellipsis': SymbolByName('HORIZONTAL ELLIPSIS'), 'textemdash': SymbolByName('EM DASH'), 'textendash': SymbolByName('EN DASH'), 'textexclamdown': SymbolByName('INVERTED EXCLAMATION MARK'), 'textgreater': Symbol('>'), 'textless': Symbol('<'), 'textordfeminine': SymbolByName('FEMININE ORDINAL INDICATOR'), 'textordmasculine': SymbolByName('MASCULINE ORDINAL INDICATOR'), 'textparagraph': SymbolByName('PILCROW SIGN'), 'textperiodcentered': SymbolByName('MIDDLE DOT'), 'textquestiondown': SymbolByName('INVERTED QUESTION MARK'), 'textquotedbl': Symbol('"'), 'textquotedblleft': SymbolByName('LEFT DOUBLE QUOTATION MARK'), 'textquotedblright': SymbolByName('RIGHT DOUBLE QUOTATION MARK'), 'textquoteleft': SymbolByName('LEFT SINGLE QUOTATION MARK'), 'textquoteright': SymbolByName('RIGHT SINGLE QUOTATION MARK'), 'textregistered': SymbolByName('REGISTERED SIGN'), 'textsection': SymbolByName('SECTION SIGN'), 'textsterling': SymbolByName('POUND SIGN'), 'texttrademark': SymbolByName('TRADE MARK SIGN'), 'textunderscore': Symbol('_'), 'textvisiblespace': SymbolByName('OPEN BOX'), 'TeX': Macro(0, 'TeX'), # escaped characters ' ': Symbol(' '), '&': Symbol('&'), '$': Symbol('$'), '{': Symbol('{'), '}': Symbol('}'), '%': Symbol('%'), '#': Symbol('#'), '_': Symbol('_'), } citeproc-py-0.3.0/citeproc/source/json.py0000644000076500000240000000753512422664261021171 0ustar brechtmstaff00000000000000 from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * import sys import unicodedata from . import BibliographySource, Reference from . import Pages, Name, Date, DateRange, LiteralDate from ..string import String, MixedString, NoCase from .. import NAMES, DATES, NUMBERS class CiteProcJSON(BibliographySource): def __init__(self, json_data): for ref in json_data: ref_data = {} for key, value in ref.items(): python_key = key.replace('-', '_') if python_key == 'id': ref_key = str(value).lower() continue elif python_key == 'type': ref_type = value continue elif python_key == 'key': # conflicts with the ref_key, so ignore continue if python_key == 'shortTitle': python_key = 'title_short' if python_key == 'page': value = self.parse_page(value) elif python_key in NAMES: value = self.parse_names(value) elif python_key in DATES: value = self.parse_date(value) elif key not in ('language', ): value = self.parse_string(value) ref_data[python_key] = value self.add(Reference(ref_key, ref_type, **ref_data)) start_tag = '' end_tag = '' def parse_string(self, string): string = str(string) lower_string = string.lower() end = 0 output = MixedString() try: while True: start = lower_string.index(self.start_tag, end) regular = string[end:start] if regular: output += String(regular) end = lower_string.index(self.end_tag, start + 1) start += len(self.start_tag) no_case = string[start:end] output += NoCase(no_case) end += len(self.end_tag) except ValueError: regular = string[end:] if regular: output += String(regular) return output def parse_page(self, json_data): json_data = json_data.replace(unicodedata.lookup('EN DASH'), '-') if '-' in json_data: first, last = (number.strip() for number in json_data.split('-')) if len(last) < len(first): last = first[:- len(last)] + last return Pages(first=first, last=last) else: return Pages(first=json_data) def parse_names(self, json_data): names = [] for name_data in json_data: name = Name(**name_data) names.append(name) return names def parse_date(self, json_data): def parse_single_date(json_date): date_data = {} try: for i, part in enumerate(('year', 'month', 'day')): date_data[part] = json_date[i] except IndexError: pass return date_data dates = [] for json_date in json_data.get('date-parts', []): date = parse_single_date(json_date) if 'season' in json_data: date['season'] = json_data['season'] dates.append(date) circa = json_data.get('circa', 0) != 0 if len(dates) == 1: return Date(circa=circa, **dates[0]) elif len(dates) > 1: return DateRange(begin=Date(**dates[0]), end=Date(**dates[1]), circa=circa) elif 'literal' in json_data: return LiteralDate(json_data['literal'], circa=circa) else: return None citeproc-py-0.3.0/citeproc/string.py0000644000076500000240000000707012427163244020220 0ustar brechtmstaff00000000000000 from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * from functools import wraps def discard_empty_other(method): """Decorator for addition operator methods that returns the object itself if `other` is the empty string.""" @wraps(method) def wrapper(obj, other): if other == '': return obj else: return method(obj, other) return wrapper class String(str): @discard_empty_other def __radd__(self, other): return MixedString([other]).__add__(self) @discard_empty_other def __add__(self, other): return MixedString([self]).__add__(other) def __iadd__(self, other): return self.__add__(other) def replace(self, *args, **kwargs): return self.__class__(super(String, self).replace(*args, **kwargs)) def rstrip(self, *args, **kwargs): return self.__class__(super(String, self).rstrip(*args, **kwargs)) def lower(self): return self.__class__(super(String, self).lower()) def upper(self): return self.__class__(super(String, self).upper()) def soft_lower(self): return self.lower() def soft_upper(self): return self.upper() def capitalize_first(self): return self.__class__(self[0].upper() + self[1:]) def words(self): for word in self.split(): yield self.__class__(word) class MixedString(list): @discard_empty_other def __add__(self, other): super_obj = super(MixedString, self) try: return self.__class__(super_obj.__add__(other)) except TypeError: return self.__class__(super_obj.__add__(MixedString([other]))) @discard_empty_other def __radd__(self, other): return self.__class__([other]).__add__(self) def __iadd__(self, other): return self.__add__(other) def __str__(self): return ''.join(map(str, self)) def __getitem__(self, index): return str(self)[index] def replace(self, *args): return self.__class__([string.replace(*args) for string in self]) def translate(self, table): return self.__class__([string.translate(table) for string in self]) def lower(self): return self.__class__([string.lower() for string in self]) def upper(self): return self.__class__([string.upper() for string in self]) def title(self): return self.__class__([string.title() for string in self]) def capitalize_first(self): self_iter = iter(self) output = [next(self_iter).capitalize_first()] output += [string for string in self_iter] return self.__class__(output) def isupper(self): return all(string.isupper() for string in self) def split(self, *args, **kwargs): return str(self).split(*args, **kwargs) def rstrip(self, *args, **kwargs): rev_iter = reversed(self) output = [next(rev_iter).rstrip(*args, **kwargs)] output += [string for string in rev_iter] return self.__class__(reversed(output)) def words(self): for string in self: for word in string.words(): yield word if PY2: MixedString.__unicode__ = MixedString.__str__ del MixedString.__str__ class NoCase(String): def __repr__(self): return '{}({})'.format(self.__class__.__name__, str(self)) def soft_lower(self): return self def soft_upper(self): return self def capitalize_first(self): return self citeproc-py-0.3.0/citeproc/types.py0000644000076500000240000000151512375162470020056 0ustar brechtmstaff00000000000000 ARTICLE = 'article' ARTICLE_JOURNAL = 'article-journal' ARTICLE_MAGAZINE = 'article-magazine' ARTICLE_NEWSPAPER = 'article-newspaper' BILL = 'bill' BOOK = 'book' BROADCAST = 'broadcast' CHAPTER = 'chapter' ENTRY = 'entry' ENTRY_DICTIONARY = 'entry-dictionary' ENTRY_ENCYCLOPEDIA = 'entry-encyclopedia' FIGURE = 'figure' GRAPHIC = 'graphic' INTERVIEW = 'interview' LEGAL_CASE = 'legal_case' LEGISLATION = 'legislation' MANUSCRIPT = 'manuscript' MAP = 'map' MOTION_PICTURE = 'motion_picture' MUSICAL_SCORE = 'musical_score' PAMPHLET = 'pamphlet' PAPER_CONFERENCE = 'paper-conference' PATENT = 'patent' PERSONAL_COMMUNICATION = 'personal_communication' POST = 'post' POST_WEBLOG = 'post-weblog' REPORT = 'report' REVIEW = 'review' REVIEW_BOOK = 'review-book' SONG = 'song' SPEECH = 'speech' THESIS = 'thesis' TREATY = 'treaty' WEBPAGE = 'webpage' citeproc-py-0.3.0/citeproc/version.py0000644000076500000240000000010112427163401020356 0ustar brechtmstaff00000000000000__version__ = '0.3.0' __release_date__ = 'Nov 07 2014, 16:36:33' citeproc-py-0.3.0/citeproc_py.egg-info/0000755000076500000240000000000012427163401020531 5ustar brechtmstaff00000000000000citeproc-py-0.3.0/citeproc_py.egg-info/dependency_links.txt0000644000076500000240000000000112427163401024577 0ustar brechtmstaff00000000000000 citeproc-py-0.3.0/citeproc_py.egg-info/PKG-INFO0000644000076500000240000001043112427163401021625 0ustar brechtmstaff00000000000000Metadata-Version: 1.1 Name: citeproc-py Version: 0.3.0 Summary: Citations and bibliography formatter Home-page: https://github.com/brechtm/citeproc-py Author: Brecht Machiels Author-email: brecht@mos6581.org License: 2-clause BSD License Description: =========== citeproc-py =========== citeproc-py is a `CSL`_ processor for Python. It aims to implement the `CSL 1.0.1 specification`_. citeproc-py can output styled citations and bibliographies in a number of different output formats. Currently supported are plain text, reStructuredText and HTML. Other formats can be added easily. citeproc-py uses `semantic versioning`_. Currently, its major version number is still at 0, meaning the API is not yet stable. However, you should not expect to see any major API changes soon. .. _CSL: http://citationstyles.org/ .. _CSL 1.0.1 specification: http://citationstyles.org/documentation/ .. _semantic versioning: http://semver.org/ Requirements ------------ citeproc-py has been developed for Python 3 but also runs on Python 2.6+. It depends on `lxml`_ for parsing and navigating the CSL style and locale files. .. _lxml: http://lxml.de/ Getting Started --------------- To get started with citeproc-py, take a look at the examples under ``examples/``. Two examples are provided, one parsing references from a JSON representation of references as supported by citeproc-js, another parsing the references from a BibTeX file. Both show and explain how to cite references and render the bibliography. CSL Compatibility ----------------- Currently, citeproc-py passes almost 60% of the (relevant) tests in the `citeproc-test suite`_. However, it is more than 60% complete, as citeproc-py doesn't take care of double spaces and repeated punctuation marks yet, making a good deal of the tests fail. In addition, the following features have not yet been implemented (there are probably some I forgot though): - disambiguation/year-suffix - et-al-subsequent-min/et-al-subsequent-use-first - collapsing - punctuation-in-quote - display Also, some `citeproc-js`_ functionality that is not part of the CSL spec is not (yet) supported: - raw dates - static-ordering - literal names .. _citeproc-test suite: https://bitbucket.org/bdarcus/citeproc-test .. _citeproc-js: http://bitbucket.org/fbennett/citeproc-js/wiki/Home Running the Tests ----------------- First clone the `citeproc-test suite`_ so that it sits next to the citeproc-py directory. Then run the ``processor.py`` script to generate the test fixtures (using Python 2.x). After that, you can run ``citeproc-test.py`` (in the ``tests`` directory). Run ``citeproc-test.py --help`` to see its usage information. .. _citeproc-test suite: https://bitbucket.org/bdarcus/citeproc-test Keywords: csl citation html rst bibtex xml Platform: UNKNOWN Classifier: Development Status :: 3 - Alpha Classifier: Environment :: Console Classifier: Environment :: Other Environment Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Education Classifier: Intended Audience :: End Users/Desktop Classifier: Intended Audience :: Legal Industry Classifier: Intended Audience :: Other Audience Classifier: Intended Audience :: Science/Research Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Topic :: Documentation Classifier: Topic :: Printing Classifier: Topic :: Software Development :: Documentation Classifier: Topic :: Software Development :: Libraries :: Python Modules Provides: citeproc citeproc-py-0.3.0/citeproc_py.egg-info/requires.txt0000644000076500000240000000000512427163401023124 0ustar brechtmstaff00000000000000lxml citeproc-py-0.3.0/citeproc_py.egg-info/SOURCES.txt0000644000076500000240000000553412427163401022424 0ustar brechtmstaff00000000000000LICENSE MANIFEST.in README.rst setup.py bin/csl_unsorted citeproc/__init__.py citeproc/frontend.py citeproc/model.py citeproc/py2compat.py citeproc/string.py citeproc/types.py citeproc/version.py citeproc/data/locales/locales-af-ZA.xml citeproc/data/locales/locales-ar-AR.xml citeproc/data/locales/locales-bg-BG.xml citeproc/data/locales/locales-ca-AD.xml citeproc/data/locales/locales-cs-CZ.xml citeproc/data/locales/locales-da-DK.xml citeproc/data/locales/locales-de-AT.xml citeproc/data/locales/locales-de-CH.xml citeproc/data/locales/locales-de-DE.xml citeproc/data/locales/locales-el-GR.xml citeproc/data/locales/locales-en-GB.xml citeproc/data/locales/locales-en-US.xml citeproc/data/locales/locales-es-ES.xml citeproc/data/locales/locales-et-EE.xml citeproc/data/locales/locales-eu.xml citeproc/data/locales/locales-fa-IR.xml citeproc/data/locales/locales-fi-FI.xml citeproc/data/locales/locales-fr-CA.xml citeproc/data/locales/locales-fr-FR.xml citeproc/data/locales/locales-he-IL.xml citeproc/data/locales/locales-hr-HR.xml citeproc/data/locales/locales-hu-HU.xml citeproc/data/locales/locales-is-IS.xml citeproc/data/locales/locales-it-IT.xml citeproc/data/locales/locales-ja-JP.xml citeproc/data/locales/locales-km-KH.xml citeproc/data/locales/locales-ko-KR.xml citeproc/data/locales/locales-lt-LT.xml citeproc/data/locales/locales-lv-LV.xml citeproc/data/locales/locales-mn-MN.xml citeproc/data/locales/locales-nb-NO.xml citeproc/data/locales/locales-nl-NL.xml citeproc/data/locales/locales-nn-NO.xml citeproc/data/locales/locales-pl-PL.xml citeproc/data/locales/locales-pt-BR.xml citeproc/data/locales/locales-pt-PT.xml citeproc/data/locales/locales-ro-RO.xml citeproc/data/locales/locales-ru-RU.xml citeproc/data/locales/locales-sk-SK.xml citeproc/data/locales/locales-sl-SI.xml citeproc/data/locales/locales-sr-RS.xml citeproc/data/locales/locales-sv-SE.xml citeproc/data/locales/locales-th-TH.xml citeproc/data/locales/locales-tr-TR.xml citeproc/data/locales/locales-uk-UA.xml citeproc/data/locales/locales-vi-VN.xml citeproc/data/locales/locales-zh-CN.xml citeproc/data/locales/locales-zh-TW.xml citeproc/data/schema/csl-categories.rng citeproc/data/schema/csl-terms.rng citeproc/data/schema/csl-types.rng citeproc/data/schema/csl-variables.rng citeproc/data/schema/csl.rng citeproc/data/styles/harvard1.csl citeproc/formatter/__init__.py citeproc/formatter/html.py citeproc/formatter/plain.py citeproc/formatter/rst.py citeproc/source/__init__.py citeproc/source/json.py citeproc/source/bibtex/__init__.py citeproc/source/bibtex/bibparse.py citeproc/source/bibtex/bibtex.py citeproc/source/bibtex/latex/__init__.py citeproc/source/bibtex/latex/macro.py citeproc_py.egg-info/PKG-INFO citeproc_py.egg-info/SOURCES.txt citeproc_py.egg-info/dependency_links.txt citeproc_py.egg-info/requires.txt citeproc_py.egg-info/top_level.txt examples/bibtex.py examples/citeproc_json.py examples/xampl.bibciteproc-py-0.3.0/citeproc_py.egg-info/top_level.txt0000644000076500000240000000001112427163401023253 0ustar brechtmstaff00000000000000citeproc citeproc-py-0.3.0/examples/0000755000076500000240000000000012427163401016335 5ustar brechtmstaff00000000000000citeproc-py-0.3.0/examples/bibtex.py0000755000076500000240000000512412427141751020175 0ustar brechtmstaff00000000000000#!/usr/bin/env python from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * # The references are parsed from a BibTeX database, so we import the # corresponding parser. from citeproc.source.bibtex import BibTeX # Import the citeproc-py classes we'll use below. from citeproc import CitationStylesStyle, CitationStylesBibliography from citeproc import formatter from citeproc import Citation, CitationItem # Parse the BibTeX database. bib_source = BibTeX('xampl.bib') # load a CSL style (from the current directory) bib_style = CitationStylesStyle('harvard1', validate=False) # Create the citeproc-py bibliography, passing it the: # * CitationStylesStyle, # * BibliographySource (BibTeX in this case), and # * a formatter (plain, html, or you can write a custom formatter) bibliography = CitationStylesBibliography(bib_style, bib_source, formatter.plain) # Processing citations in a document needs to be done in two passes as for some # CSL styles, a citation can depend on the order of citations in the # bibliography and thus on citations following the current one. # For this reason, we first need to register all citations with the # CitationStylesBibliography. citation1 = Citation([CitationItem('whole-collection')]) citation2 = Citation([CitationItem('whole-set'), CitationItem('misc-full')]) citation3 = Citation([CitationItem('techreport-full')]) citation4 = Citation([CitationItem('mastersthesis-minimal')]) citation5 = Citation([CitationItem('inproceedings-full'), CitationItem('unpublished-full')]) bibliography.register(citation1) bibliography.register(citation2) bibliography.register(citation3) bibliography.register(citation4) bibliography.register(citation5) # In the second pass, CitationStylesBibliography can generate citations. # CitationStylesBibliography.cite() requires a callback function to be passed # along to be called in case a CitationItem's key is not present in the # bibliography. def warn(citation_item): print("WARNING: Reference with key '{}' not found in the bibliography." .format(citation_item.key)) print('Citations') print('---------') print(bibliography.cite(citation1, warn)) print(bibliography.cite(citation2, warn)) print(bibliography.cite(citation3, warn)) print(bibliography.cite(citation4, warn)) print(bibliography.cite(citation5, warn)) # And finally, the bibliography can be rendered. print('') print('Bibliography') print('------------') for item in bibliography.bibliography(): print(str(item)) citeproc-py-0.3.0/examples/citeproc_json.py0000755000076500000240000001054612426473422021567 0ustar brechtmstaff00000000000000#!/usr/bin/env python from __future__ import (absolute_import, division, print_function, unicode_literals) from citeproc.py2compat import * # We'll use json.loads for parsing the JSON data. import json # Import the citeproc-py classes we'll use below. from citeproc import CitationStylesStyle, CitationStylesBibliography from citeproc import Citation, CitationItem from citeproc import formatter from citeproc.source.json import CiteProcJSON # The following JSON data describes 5 references picked from the CSL test suite. json_input = """ [ { "id": "ITEM-1", "issued": { "date-parts": [[1987, 8, 3], [2003, 10, 23]] }, "title": "Ignore me", "type": "book" }, { "id" : "ITEM-2", "page" : "1-7", "type" : "article-journal", "issued" : { "date-parts": [[2006]] } }, { "author": [ { "family": "Doe", "given": "John" } ], "id": "ITEM-3", "issued": { "date-parts": [["1965", "6", "1"]] }, "title": "His Anonymous Life", "type": "book" }, { "author": [ { "family": "Grignon", "given": "Cyril" }, { "family": "Sentenac", "given": "Corey" } ], "id": "ITEM-4", "issued": { "date-parts": [[2000]] }, "type": "book" }, { "id": "ITEM-5", "title":"Boundaries of Dissent: Protest and State Power in the Media Age", "author": [ { "family": "D'Arcus", "given": "Bruce", "static-ordering": false } ], "publisher": "Routledge", "publisher-place": "New York", "issued": { "date-parts":[[2006]] }, "type": "book", "URL": "http://www.test01.com" } ] """ # Parse the JSON input using json.loads() # (parsing from a file object can be done with json.load) json_data = json.loads(json_input) # Process the JSON data to generate a citeproc-py BibliographySource. bib_source = CiteProcJSON(json_data) ##for key, entry in bib_source.items(): ## print(key) ## for name, value in entry.items(): ## print(' {}: {}'.format(name, value)) # load a CSL style (from the current directory) bib_style = CitationStylesStyle('harvard1', validate=False) # Create the citeproc-py bibliography, passing it the: # * CitationStylesStyle, # * BibliographySource (CiteProcJSON in this case), and # * a formatter (plain, html, or you can write a custom formatter) bibliography = CitationStylesBibliography(bib_style, bib_source, formatter.html) # Processing citations in a document needs to be done in two passes as for some # CSL styles, a citation can depend on the order of citations in the # bibliography and thus on citations following the current one. # For this reason, we first need to register all citations with the # CitationStylesBibliography. citation1 = Citation([CitationItem('ITEM-3')]) citation2 = Citation([CitationItem('ITEM-1'), CitationItem('ITEM-2')]) citation3 = Citation([CitationItem('ITEM-4')]) citation4 = Citation([CitationItem('ITEM-5')]) citation5 = Citation([CitationItem('MISSING')]) bibliography.register(citation1) bibliography.register(citation2) bibliography.register(citation3) bibliography.register(citation4) bibliography.register(citation5) # In the second pass, CitationStylesBibliography can generate citations. # CitationStylesBibliography.cite() requires a callback function to be passed # along to be called in case a CitationItem's key is not present in the # bibliography. def warn(citation_item): print("WARNING: Reference with key '{}' not found in the bibliography." .format(citation_item.key)) print('Citations') print('---------') print(bibliography.cite(citation1, warn)) print(bibliography.cite(citation2, warn)) print(bibliography.cite(citation3, warn)) print(bibliography.cite(citation4, warn)) print(bibliography.cite(citation5, warn)) # And finally, the bibliography can be rendered. print('') print('Bibliography') print('------------') for item in bibliography.bibliography(): print(str(item)) citeproc-py-0.3.0/examples/xampl.bib0000644000076500000240000002362512426254466020157 0ustar brechtmstaff00000000000000% Copyright (C) 1988, 2010 Oren Patashnik. % Unlimited copying and redistribution of this file are permitted if it % is unmodified. Modifications (and their redistribution) are also % permitted, as long as the resulting file is renamed. @preamble{ "\newcommand{\noopsort}[1]{} " # "\newcommand{\printfirst}[2]{#1} " # "\newcommand{\singleletter}[1]{#1} " # "\newcommand{\switchargs}[2]{#2#1} " } @ARTICLE{article-minimal, author = {L[eslie] A. Aamport}, title = {The Gnats and Gnus Document Preparation System}, journal = {\mbox{G-Animal's} Journal}, year = 1986, } @ARTICLE{article-full, author = {L[eslie] A. Aamport}, title = {The Gnats and Gnus Document Preparation System}, journal = {\mbox{G-Animal's} Journal}, year = 1986, volume = 41, number = 7, pages = "73+", month = jul, note = "This is a full ARTICLE entry", } The KEY field is here to override the KEY field in the journal being cross referenced (so is the NOTE field, in addition to its imparting information). @ARTICLE{article-crossref, crossref = {WHOLE-JOURNAL}, key = "", author = {L[eslie] A. Aamport}, title = {The Gnats and Gnus Document Preparation System}, pages = "73+", note = "This is a cross-referencing ARTICLE entry", } @ARTICLE{whole-journal, key = "GAJ", journal = {\mbox{G-Animal's} Journal}, year = 1986, volume = 41, number = 7, month = jul, note = {The entire issue is devoted to gnats and gnus (this entry is a cross-referenced ARTICLE (journal))}, } @INBOOK{inbook-minimal, author = "Donald E. Knuth", title = "Fundamental Algorithms", publisher = "Addison-Wesley", year = "{\noopsort{1973b}}1973", chapter = "1.2", } @INBOOK{inbook-full, author = "Donald E. Knuth", title = "Fundamental Algorithms", volume = 1, series = "The Art of Computer Programming", publisher = "Addison-Wesley", address = "Reading, Massachusetts", edition = "Second", month = "10~" # jan, year = "{\noopsort{1973b}}1973", type = "Section", chapter = "1.2", pages = "10--119", note = "This is a full INBOOK entry", } @INBOOK{inbook-crossref, crossref = "whole-set", title = "Fundamental Algorithms", volume = 1, series = "The Art of Computer Programming", edition = "Second", year = "{\noopsort{1973b}}1973", type = "Section", chapter = "1.2", note = "This is a cross-referencing INBOOK entry", } @BOOK{book-minimal, author = "Donald E. Knuth", title = "Seminumerical Algorithms", publisher = "Addison-Wesley", year = "{\noopsort{1973c}}1981", } @BOOK{book-full, author = "Donald E. Knuth", title = "Seminumerical Algorithms", volume = 2, series = "The Art of Computer Programming", publisher = "Addison-Wesley", address = "Reading, Massachusetts", edition = "Second", month = "10~" # jan, year = "{\noopsort{1973c}}1981", note = "This is a full BOOK entry", } @BOOK{book-crossref, crossref = "whole-set", title = "Seminumerical Algorithms", volume = 2, series = "The Art of Computer Programming", edition = "Second", year = "{\noopsort{1973c}}1981", note = "This is a cross-referencing BOOK entry", } @BOOK{whole-set, author = "Donald E. Knuth", publisher = "Addison-Wesley", title = "The Art of Computer Programming", series = "Four volumes", year = "{\noopsort{1973a}}{\switchargs{--90}{1968}}", note = "Seven volumes planned (this is a cross-referenced set of BOOKs)", } @BOOKLET{booklet-minimal, key = "Kn{\printfirst{v}{1987}}", title = "The Programming of Computer Art", } @BOOKLET{booklet-full, author = "Jill C. Knvth", title = "The Programming of Computer Art", howpublished = "Vernier Art Center", address = "Stanford, California", month = feb, year = 1988, note = "This is a full BOOKLET entry", } @INCOLLECTION{incollection-minimal, author = "Daniel D. Lincoll", title = "Semigroups of Recurrences", booktitle = "High Speed Computer and Algorithm Organization", publisher = "Academic Press", year = 1977, } @INCOLLECTION{incollection-full, author = "Daniel D. Lincoll", title = "Semigroups of Recurrences", editor = "David J. Lipcoll and D. H. Lawrie and A. H. Sameh", booktitle = "High Speed Computer and Algorithm Organization", number = 23, series = "Fast Computers", chapter = 3, type = "Part", pages = "179--183", publisher = "Academic Press", address = "New York", edition = "Third", month = sep, year = 1977, note = "This is a full INCOLLECTION entry", } @INCOLLECTION{incollection-crossref, crossref = "whole-collection", author = "Daniel D. Lincoll", title = "Semigroups of Recurrences", pages = "179--183", note = "This is a cross-referencing INCOLLECTION entry", } @BOOK{whole-collection, editor = "David J. Lipcoll and D. H. Lawrie and A. H. Sameh", title = "High Speed Computer and Algorithm Organization", booktitle = "High Speed Computer and Algorithm Organization", number = 23, series = "Fast Computers", publisher = "Academic Press", address = "New York", edition = "Third", month = sep, year = 1977, note = "This is a cross-referenced BOOK (collection) entry", } @MANUAL{manual-minimal, key = "Manmaker", title = "The Definitive Computer Manual", } @MANUAL{manual-full, author = "Larry Manmaker", title = "The Definitive Computer Manual", organization = "Chips-R-Us", address = "Silicon Valley", edition = "Silver", month = apr # "-" # may, year = 1986, note = "This is a full MANUAL entry", } @MASTERSTHESIS{mastersthesis-minimal, author = "{\'{E}}douard Masterly", title = "Mastering Thesis Writing", school = "Stanford University", year = 1988, } @MASTERSTHESIS{mastersthesis-full, author = "{\'{E}}douard Masterly", title = "Mastering Thesis Writing", school = "Stanford University", type = "Master's project", address = "English Department", month = jun # "-" # aug, year = 1988, note = "This is a full MASTERSTHESIS entry", } @MISC{misc-minimal, key = "Missilany", note = "This is a minimal MISC entry", } @MISC{misc-full, author = "Joe-Bob Missilany", title = "Handing out random pamphlets in airports", howpublished = "Handed out at O'Hare", month = oct, year = 1984, note = "This is a full MISC entry", } @STRING{STOC-key = "OX{\singleletter{stoc}}"} @STRING{ACM = "The OX Association for Computing Machinery"} @STRING{STOC = " Symposium on the Theory of Computing"} @INPROCEEDINGS{inproceedings-minimal, author = "Alfred V. Oaho and Jeffrey D. Ullman and Mihalis Yannakakis", title = "On Notions of Information Transfer in {VLSI} Circuits", booktitle = "Proc. Fifteenth Annual ACM" # STOC, year = 1983, } @INPROCEEDINGS{inproceedings-full, author = "Alfred V. Oaho and Jeffrey D. Ullman and Mihalis Yannakakis", title = "On Notions of Information Transfer in {VLSI} Circuits", editor = "Wizard V. Oz and Mihalis Yannakakis", booktitle = "Proc. Fifteenth Annual ACM" # STOC, number = 17, series = "All ACM Conferences", pages = "133--139", month = mar, year = 1983, address = "Boston", organization = ACM, publisher = "Academic Press", note = "This is a full INPROCEDINGS entry", } @INPROCEEDINGS{inproceedings-crossref, crossref = "whole-proceedings", author = "Alfred V. Oaho and Jeffrey D. Ullman and Mihalis Yannakakis", title = "On Notions of Information Transfer in {VLSI} Circuits", organization = "", pages = "133--139", note = "This is a cross-referencing INPROCEEDINGS entry", } @PROCEEDINGS{proceedings-minimal, key = STOC-key, title = "Proc. Fifteenth Annual" # STOC, year = 1983, } @PROCEEDINGS{proceedings-full, editor = "Wizard V. Oz and Mihalis Yannakakis", title = "Proc. Fifteenth Annual" # STOC, number = 17, series = "All ACM Conferences", month = mar, year = 1983, address = "Boston", organization = ACM, publisher = "Academic Press", note = "This is a full PROCEEDINGS entry", } @PROCEEDINGS{whole-proceedings, key = STOC-key, organization = ACM, title = "Proc. Fifteenth Annual" # STOC, address = "Boston", year = 1983, booktitle = "Proc. Fifteenth Annual ACM" # STOC, note = "This is a cross-referenced PROCEEDINGS", } @PHDTHESIS{phdthesis-minimal, author = "F. Phidias Phony-Baloney", title = "Fighting Fire with Fire: Festooning {F}rench Phrases", school = "Fanstord University", year = 1988, } @PHDTHESIS{phdthesis-full, author = "F. Phidias Phony-Baloney", title = "Fighting Fire with Fire: Festooning {F}rench Phrases", school = "Fanstord University", type = "{PhD} Dissertation", address = "Department of French", month = jun # "-" # aug, year = 1988, note = "This is a full PHDTHESIS entry", } @TECHREPORT{techreport-minimal, author = "Tom Terrific", title = "An {$O(n \log n / \! \log\log n)$} Sorting Algorithm", institution = "Fanstord University", year = 1988, } @TECHREPORT{techreport-full, author = "Tom T{\'{e}}rrific", title = "An {$O(n \log n / \! \log\log n)$} Sorting Algorithm", institution = "Fanstord University", type = "Wishful Research Result", number = "7", address = "Computer Science Department, Fanstord, California", month = oct, year = 1988, note = "This is a full TECHREPORT entry", } @UNPUBLISHED{unpublished-minimal, author = "Ulrich {\"{U}}nderwood and Ned {\~N}et and Paul {\={P}}ot", title = "Lower Bounds for Wishful Research Results", note = "Talk at Fanstord University (this is a minimal UNPUBLISHED entry)", } @UNPUBLISHED{unpublished-full, author = "Ulrich {\"{U}}nderwood and Ned {\~N}et and Paul {\={P}}ot", title = "Lower Bounds for Wishful Research Results", month = nov # ", " # dec, year = 1988, note = "Talk at Fanstord University (this is a full UNPUBLISHED entry)", } @MISC{random-note-crossref, key = {Volume-2}, note = "Volume~2 is listed under Knuth \cite{book-full}" } citeproc-py-0.3.0/LICENSE0000644000076500000240000000277612375162470015547 0ustar brechtmstaff00000000000000Copyright 2011-2013 Brecht Machiels. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the copyright holder. citeproc-py-0.3.0/MANIFEST.in0000644000076500000240000000016112375162470016262 0ustar brechtmstaff00000000000000include LICENSE README.rst recursive-include docs *.html *.css *.png recursive-include examples *.py *.csl *.bib citeproc-py-0.3.0/PKG-INFO0000644000076500000240000001043112427163401015613 0ustar brechtmstaff00000000000000Metadata-Version: 1.1 Name: citeproc-py Version: 0.3.0 Summary: Citations and bibliography formatter Home-page: https://github.com/brechtm/citeproc-py Author: Brecht Machiels Author-email: brecht@mos6581.org License: 2-clause BSD License Description: =========== citeproc-py =========== citeproc-py is a `CSL`_ processor for Python. It aims to implement the `CSL 1.0.1 specification`_. citeproc-py can output styled citations and bibliographies in a number of different output formats. Currently supported are plain text, reStructuredText and HTML. Other formats can be added easily. citeproc-py uses `semantic versioning`_. Currently, its major version number is still at 0, meaning the API is not yet stable. However, you should not expect to see any major API changes soon. .. _CSL: http://citationstyles.org/ .. _CSL 1.0.1 specification: http://citationstyles.org/documentation/ .. _semantic versioning: http://semver.org/ Requirements ------------ citeproc-py has been developed for Python 3 but also runs on Python 2.6+. It depends on `lxml`_ for parsing and navigating the CSL style and locale files. .. _lxml: http://lxml.de/ Getting Started --------------- To get started with citeproc-py, take a look at the examples under ``examples/``. Two examples are provided, one parsing references from a JSON representation of references as supported by citeproc-js, another parsing the references from a BibTeX file. Both show and explain how to cite references and render the bibliography. CSL Compatibility ----------------- Currently, citeproc-py passes almost 60% of the (relevant) tests in the `citeproc-test suite`_. However, it is more than 60% complete, as citeproc-py doesn't take care of double spaces and repeated punctuation marks yet, making a good deal of the tests fail. In addition, the following features have not yet been implemented (there are probably some I forgot though): - disambiguation/year-suffix - et-al-subsequent-min/et-al-subsequent-use-first - collapsing - punctuation-in-quote - display Also, some `citeproc-js`_ functionality that is not part of the CSL spec is not (yet) supported: - raw dates - static-ordering - literal names .. _citeproc-test suite: https://bitbucket.org/bdarcus/citeproc-test .. _citeproc-js: http://bitbucket.org/fbennett/citeproc-js/wiki/Home Running the Tests ----------------- First clone the `citeproc-test suite`_ so that it sits next to the citeproc-py directory. Then run the ``processor.py`` script to generate the test fixtures (using Python 2.x). After that, you can run ``citeproc-test.py`` (in the ``tests`` directory). Run ``citeproc-test.py --help`` to see its usage information. .. _citeproc-test suite: https://bitbucket.org/bdarcus/citeproc-test Keywords: csl citation html rst bibtex xml Platform: UNKNOWN Classifier: Development Status :: 3 - Alpha Classifier: Environment :: Console Classifier: Environment :: Other Environment Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Education Classifier: Intended Audience :: End Users/Desktop Classifier: Intended Audience :: Legal Industry Classifier: Intended Audience :: Other Audience Classifier: Intended Audience :: Science/Research Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Topic :: Documentation Classifier: Topic :: Printing Classifier: Topic :: Software Development :: Documentation Classifier: Topic :: Software Development :: Libraries :: Python Modules Provides: citeproc citeproc-py-0.3.0/README.rst0000644000076500000240000000470412375162470016222 0ustar brechtmstaff00000000000000=========== citeproc-py =========== citeproc-py is a `CSL`_ processor for Python. It aims to implement the `CSL 1.0.1 specification`_. citeproc-py can output styled citations and bibliographies in a number of different output formats. Currently supported are plain text, reStructuredText and HTML. Other formats can be added easily. citeproc-py uses `semantic versioning`_. Currently, its major version number is still at 0, meaning the API is not yet stable. However, you should not expect to see any major API changes soon. .. _CSL: http://citationstyles.org/ .. _CSL 1.0.1 specification: http://citationstyles.org/documentation/ .. _semantic versioning: http://semver.org/ Requirements ------------ citeproc-py has been developed for Python 3 but also runs on Python 2.6+. It depends on `lxml`_ for parsing and navigating the CSL style and locale files. .. _lxml: http://lxml.de/ Getting Started --------------- To get started with citeproc-py, take a look at the examples under ``examples/``. Two examples are provided, one parsing references from a JSON representation of references as supported by citeproc-js, another parsing the references from a BibTeX file. Both show and explain how to cite references and render the bibliography. CSL Compatibility ----------------- Currently, citeproc-py passes almost 60% of the (relevant) tests in the `citeproc-test suite`_. However, it is more than 60% complete, as citeproc-py doesn't take care of double spaces and repeated punctuation marks yet, making a good deal of the tests fail. In addition, the following features have not yet been implemented (there are probably some I forgot though): - disambiguation/year-suffix - et-al-subsequent-min/et-al-subsequent-use-first - collapsing - punctuation-in-quote - display Also, some `citeproc-js`_ functionality that is not part of the CSL spec is not (yet) supported: - raw dates - static-ordering - literal names .. _citeproc-test suite: https://bitbucket.org/bdarcus/citeproc-test .. _citeproc-js: http://bitbucket.org/fbennett/citeproc-js/wiki/Home Running the Tests ----------------- First clone the `citeproc-test suite`_ so that it sits next to the citeproc-py directory. Then run the ``processor.py`` script to generate the test fixtures (using Python 2.x). After that, you can run ``citeproc-test.py`` (in the ``tests`` directory). Run ``citeproc-test.py --help`` to see its usage information. .. _citeproc-test suite: https://bitbucket.org/bdarcus/citeproc-test citeproc-py-0.3.0/setup.cfg0000644000076500000240000000007312427163401016340 0ustar brechtmstaff00000000000000[egg_info] tag_date = 0 tag_build = tag_svn_revision = 0 citeproc-py-0.3.0/setup.py0000755000076500000240000000554212400035503016232 0ustar brechtmstaff00000000000000#!/usr/bin/env python """ Setup script for citeproc-py """ import os import sys from datetime import datetime from subprocess import Popen, PIPE from setuptools import setup, find_packages PACKAGE = 'citeproc' PACKAGE_ABSPATH = os.path.abspath(PACKAGE) VERSION_FILE = PACKAGE + '/version.py' # retrieve the version number from git or VERSION_FILE # inspired by http://dcreager.net/2010/02/10/setuptools-git-version-numbers/ try: print('Attempting to get version number from git...') git = Popen(['git', 'describe', '--abbrev=4', '--dirty'], stdout=PIPE, stderr=sys.stderr) if git.wait() != 0: raise OSError line = git.stdout.readlines()[0] __version__ = line.strip()[1:].decode('ascii') __release_date__ = datetime.now().strftime('%b %d %Y, %H:%M:%S') with open(VERSION_FILE, 'w') as version_file: version_file.write("__version__ = '{}'\n".format(__version__)) version_file.write("__release_date__ = '{}'\n".format(__release_date__)) except OSError as e: print('Assume we are running from a source distribution.') # read version from VERSION_FILE with open(VERSION_FILE) as version_file: code = compile(version_file.read(), VERSION_FILE, 'exec') exec(code) with open('README.rst') as file: README = file.read() setup( name='citeproc-py', version=__version__, packages=find_packages(), package_data={PACKAGE: ['data/locales/*.xml', 'data/schema/*.rng', 'data/styles/*.csl']}, scripts=['bin/csl_unsorted'], install_requires=['lxml'], provides=[PACKAGE], #test_suite='nose.collector', author='Brecht Machiels', author_email='brecht@mos6581.org', description='Citations and bibliography formatter', long_description=README, url='https://github.com/brechtm/citeproc-py', keywords='csl citation html rst bibtex xml', license='2-clause BSD License', classifiers = [ 'Development Status :: 3 - Alpha', 'Environment :: Console', 'Environment :: Other Environment', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'Intended Audience :: Education', 'Intended Audience :: End Users/Desktop', 'Intended Audience :: Legal Industry', 'Intended Audience :: Other Audience', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Topic :: Documentation', 'Topic :: Printing', 'Topic :: Software Development :: Documentation', 'Topic :: Software Development :: Libraries :: Python Modules', ] )