publist

managing my list of publications, talks, reviews
git clone https://a3nm.net/git/publist/
Log | Files | Refs | README | LICENSE

commit 6d6325c557f3a92590b4257d5a016c0c40bc829b
parent 7f9a025069bfc82abf2af91812eb248f6b9417b5
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Thu,  1 Sep 2022 08:45:04 +0200

support full names

Diffstat:
make_talks_html.py | 2+-
maketex.py | 26++++++++++++++++++++------
parserec.py | 32++++++++++++++++++++++++++------
3 files changed, 47 insertions(+), 13 deletions(-)

diff --git a/make_talks_html.py b/make_talks_html.py @@ -75,7 +75,7 @@ def makevenue2(venue, lang, typ, url, issue, links=True, hidden=False): def makevenue(publi, lang, links=True, hidenonoa=False): global venuesz - venue, typ, url, issue, oa, keywords = getvenue(publi, lang, venuesz) + venue, _, typ, url, issue, oa, keywords = getvenue(publi, lang, venuesz) if venue == 'Draft': return venue return makevenue2(venue, lang, typ, url, issue, links=links, hidden=((not oa) and hidenonoa)) diff --git a/maketex.py b/maketex.py @@ -4,6 +4,7 @@ # FORMAT is "tex" (default) or "bib" # PUBLICATION is the id of the publication to compile, or: # - "all" for all publications +# - "all_formal" for all publications with formal details # - "cv" for all CV publications: all publications that are main, reviewed, not # hidden (default) # FOLDER is where to find "publis" "venues" "authors", default is script dir @@ -15,6 +16,9 @@ import sys SITEURL="https://a3nm.net" LOCALURL=SITEURL+"/publications/" +# add full acronyms, page numbers +formal_mode = False + if len(sys.argv) > 5: print("too many arguments", file=sys.stderr) sys.exit(1) @@ -66,7 +70,11 @@ def authortotex(author, withurl=False, sepnames=False): def venuetotex(venue, url, issue, dropyear=False): if dropyear and "'" in venue: - venue = venue.split("'")[0] + # cut conf'1942, but beware of ' in titles + venue_s = venue.split("'") + if len(venue_s) == 2: + if venue_s[1].isdigit(): + venue = venue_s[0] try: if dropyear and venue[-4:].isdigit() and venue[-5] == ' ': venue = venue[:-5] @@ -80,7 +88,7 @@ def venuetotex(venue, url, issue, dropyear=False): return l def publitotex(publi, lang, venuesz, authorsz): - name, typ, url, issue, oa, keywords = getvenue(publi, lang, venuesz, True) + name, fullname, typ, url, issue, oa, keywords = getvenue(publi, lang, venuesz, True) authors = ', '.join(authortotex(authorsz[author], withurl=True) for author in publi['authors'].split(' ')) return("\\cvitem{\\bfseries %s}{%s.\\newline\\emph{%s}%s%s}" % (venuetotex(name, url, @@ -125,7 +133,7 @@ def publitobib(publi, lang, venuesz, authorsz): global typetobibtype, typetoobjtype, legaltypes, SITEURL, LOCALURL global informaltypes global stz - name, typ2, url, issue, oa, keywords = getvenue(publi, lang, venuesz) + name, fullname, typ2, url, issue, oa, keywords = getvenue(publi, lang, venuesz) s = "" typ = publi.get('type', None) if typ == None or len(typ) == 0: @@ -167,7 +175,7 @@ def publitobib(publi, lang, venuesz, authorsz): s += ' school = {%s},\n' % (mklinktex(publi['school'], publi['schoolurl'])) else: - s += ' %s = {%s},\n' % (typetoobjtype[typ], venuetotex(name, url, issue, + s += ' %s = {%s},\n' % (typetoobjtype[typ], venuetotex(fullname if formal_mode else name, url, issue, True)) if typ in ["demo", "posterpaper", "shortpaper", "spotlight"]: s += ' note = {%s},\n' % (stz[typ][lang]) @@ -176,6 +184,9 @@ def publitobib(publi, lang, venuesz, authorsz): if 'doi' in publi.keys() and publi['doi'].lower() != 'none': s += ' doi = {%s},\n' % publi['doi'] s += ' keywords = {' + ','.join(sorted(keywords)) + '},\n' + if formal_mode: + if 'extra' in publi.keys(): + s += publi['extra'] s += '}\n\n' return s @@ -184,9 +195,12 @@ fmtdict = { 'bib': publitobib, } +if thepubli == 'all_formal': + formal_mode = True + if __name__ == '__main__': for publi in parse('publis'): - if thepubli != "all": + if thepubli not in ["all", "all_formal"]: if thepubli == "cv" or not thepubli: if publi.get('reviewed', "no") == "no": # only reviewed publis @@ -203,7 +217,7 @@ if __name__ == '__main__': # just one publi if thepubli and publi['id'] != thepubli: continue - name, typ2, url, issue, oa, keywords = getvenue(publi, lang, venuesz) + name, fullname, typ2, url, issue, oa, keywords = getvenue(publi, lang, venuesz) if fmt == 'tex' and typ2 == 'journal' and publi.get('issue', "none").lower() == "none": # in latex, no journal articles without an issue number yet continue diff --git a/parserec.py b/parserec.py @@ -163,7 +163,7 @@ def endswithpunct(publi): return True return False -def mkvenuename(venueo, short=False): +def mkvenuename(venueo, short=False, year=True): venue = venueo['id'] if 'name' in venueo.keys(): return venueo['name'] @@ -178,23 +178,30 @@ def mkvenuename(venueo, short=False): # skip parts of year pos += 2 sep = "'" - return venue[:lpos].upper() + sep + venue[pos:] + if year: + return venue[:lpos].upper() + sep + venue[pos:] + else: + return venue[:lpos].upper() -# return name, type, venue URL, issue: for publi in lang given venuesz +# return name, fullname, type, venue URL, issue: for publi in lang given venuesz def getvenue(publi, lang, venuesz, short=False): global stz global talk_types if 'venue' not in publi.keys(): if 'status' in publi.keys(): - return (stz[publi['status']][lang], publi['status'], '', '', '', set()) - return ('', '', '', '', '', set()) # phdthesis or mscthesis + name = stz[publi['status']][lang] + return (name, name, publi['status'], '', '', '', set()) + return ('', '', '', '', '', '', set()) # phdthesis or mscthesis venue = publi['venue'] + venueid = venue if short and 'venueshort' in publi.keys(): venue = publi['venueshort'] url = None typ = None keywords = set() oa = None + fullname = None + venue_no_year = venue if venue in venuesz.keys(): venueo = venuesz[venue] if 'oa' not in venueo.keys(): @@ -219,7 +226,10 @@ def getvenue(publi, lang, venuesz, short=False): else 'conference')) if 'url' in venueo.keys(): url = venueo['url'] + if 'fullname' in venueo.keys(): + fullname = venueo['fullname'] venue = mkvenuename(venueo, short) + venue_no_year = mkvenuename(venueo, short, year=False) else: if 'venueurl' in publi.keys(): url = publi['venueurl'] @@ -229,7 +239,17 @@ def getvenue(publi, lang, venuesz, short=False): lvenue = 'venue' + lang if lvenue in publi.keys(): venue = publi[lvenue] - return (venue, typ, url, publi.get('issue', ''), oa in ['yes', 'n/a'], keywords) + if fullname == None: + fullname = venue + last = venueid[-4:] + if last.isdigit(): + # conf2042 => conf + venue_prev = venueid[:-4] + if venue_prev in venuesz.keys(): + if 'fullname' in venuesz[venue_prev].keys(): + fullname = venuesz[venue_prev]['fullname'] + " (" + venue_no_year + ")" + + return (venue, fullname, typ, url, publi.get('issue', ''), oa in ['yes', 'n/a'], keywords) def parse(fname): with open(fname, 'r') as f: