# ──────────────────────────────────────────────────────────────────────────
# types

types = ['article',
         'book',
         'booklet',
         'conference',
         'inbook',
         'incollection',
         'inproceedings',
         'manual',
         'mastersthesis',
         'misc',
         'phdthesis',
         'proceedings',
         'techreport',
         'unpublished']


# ──────────────────────────────────────────────────────────────────────────
# fields

required = {'article': ['author',
                        'journal',
                        'title',
                        'type',
                        'volume',
                        'year'],
                   'book': ['author', # removed editor from required
                            'publisher',
                            'title',
                            'type',
                            'year'],
                   'booklet': ['title',
                               'type'],
                   'conference': ['author',
                                  'booktitle',
                                  'title',
                                  'type',
                                  'year'],
                   'inbook': ['author', # removed editor from required
                              'chapter',
                              'pages',
                              'publisher',
                              'title',
                              'type',
                              'year'],
                   'incollection': ['author',
                                    'booktitle',
                                    'publisher',
                                    'title',
                                    'type',
                                    'year'],
                   'inproceedings': ['author',
                                     'booktitle',
                                     'title',
                                     'type',
                                     'year'],
                   'manual': ['title',
                              'type'],
                   'mastersthesis': ['author',
                                     'school',
                                     'title',
                                     'type',
                                     'year'],
                   'misc': ['type'],
                   'phdthesis': ['author',
                                 'school',
                                 'title',
                                 'type',
                                 'year'],
                   'proceedings': ['title',
                                   'type',
                                   'year'],
                   'techreport': ['author',
                                  'institution',
                                  'title',
                                  'type',
                                  'year'],
                   'unpublished': ['author',
                                   'title',
                                   'type',
                                   'note']}


optional = {'article': ['doi',
                        'issn',
                        'key',
                        'month',
                        'note',
                        'number',
                        'pages',
                        'publisher',
                        'url'],
                   'book': ['address',
                            'edition',
                            'editor',
                            'key',
                            'month',
                            'note',
                            'number',
                            'series',
                            'url',
                            'volume'],
                   'booklet': ['address',
                               'author',
                               'howpublished',
                               'key',
                               'month',
                               'note',
                               'year'],
                   'conference': ['address',
                                  'editor',
                                  'key',
                                  'month',
                                  'note',
                                  'number',
                                  'organization',
                                  'pages',
                                  'publisher',
                                  'series',
                                  'volume'],
                   'inbook': ['address',
                              'edition',
                              'key',
                              'month',
                              'note',
                              'number',
                              'series',
                              'volume'],
                   'incollection': ['address',
                                    'chapter',
                                    'edition',
                                    'editor',
                                    'key',
                                    'month',
                                    'note',
                                    'number',
                                    'pages',
                                    'series',
                                    'volume'],
                   'inproceedings': ['address',
                                     'editor',
                                     'key',
                                     'month',
                                     'note',
                                     'number',
                                     'organization',
                                     'pages',
                                     'publisher',
                                     'series',
                                     'volume'],
                   'manual': ['address',
                              'author',
                              'edition',
                              'key',
                              'month',
                              'note',
                              'organization',
                              'year'],
                   'mastersthesis': ['address',
                                     'key',
                                     'month',
                                     'note'],
                   'misc': ['author',
                            'howpublished',
                            'key',
                            'month',
                            'note',
                            'title',
                            'year'],
                   'phdthesis': ['address',
                                 'key',
                                 'month',
                                 'note'],
                   'proceedings': ['address',
                                   'editor',
                                   'key',
                                   'month',
                                   'number',
                                   'publisher',
                                   'series',
                                   'volume'],
                   'techreport': ['address',
                                  'key',
                                  'month',
                                  'note',
                                  'number'],
                   'unpublished': ['key',
                                   'month',
                                   'year']}

#  ──────────────────────────────────────────────────────────────────────────

all_fields = set()

for type in types:
    all_fields.add(type)
    for field in required[type]:
        all_fields.add(field)
    for field in optional[type]:
        all_fields.add(field)
