#! /usr/bin/python3

import unicodedata
import sys

n = len(sys.argv)
fl=""
if  ( n == 3 ):
    fl=sys.argv[1]
    start_year=int(sys.argv[2])
else:
    print( "\n\n./collaborators [bib-file] [start-year]\n\n" );
    exit

from pybtex.database import parse_file

bib_data = parse_file( fl )

#    print( rent )
#    print( ent.persons['author' ])

authors = {}

for  ent in bib_data.entries:
    rent = bib_data.entries[ ent ]
    year = rent.fields[ 'year' ]
    if  ( int(year) < start_year ):
        continue
 #   print( year )
    for author in rent.persons['author']:
        authors[ str(author) ] = 1
#        print(author)
# import bibtexparser

#with open('SarielHarPeled.bib') as bibtex_file:
#    bib_database = bibtexparser.load(bibtex_file)

#print(bib_database.entries)
authors_lst = list( authors.keys() )
authors_lst.sort()

for  au in authors_lst:
    print( au )
#print( authors_lst ) 
