How to use the betterbib.adapt_doi_urls.adapt_doi_urls function in betterbib

To help you get started, we’ve selected a few betterbib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nschloe / betterbib / betterbib / cli / full.py View on Github external
def main(argv=None):
    parser = _get_parser()
    args = parser.parse_args(argv)

    # Make sure that the entries are written out sorted by their BibTeX key if demanded.
    data = bibtex.Parser().parse_file(args.infile)
    tuples = data.entries.items()
    if args.sort_by_bibkey:
        tuples = sorted(data.entries.items())

    d = dict(tuples)

    d = sync(d, args.source, args.long_journal_names, args.num_concurrent_requests)
    d = adapt_doi_urls(d, args.doi_url_type)
    d = tools.sanitize_title(d)
    d = journal_abbrev(d, args.long_journal_names, args.extra_abbrev_file)

    tools.write(d, args.outfile, args.delimeter_type, tab_indent=args.tab_indent)
github nschloe / betterbib / betterbib / cli / format.py View on Github external
args = parser.parse_args(argv)

    data = bibtex.Parser().parse_file(args.infile)

    if args.drop:
        data = tools.filter_fields(data, args.drop)

    # Use an ordered dictionary to make sure that the entries are written out
    # sorted by their BibTeX key if demanded.
    tuples = data.entries.items()
    if args.sort_by_bibkey:
        tuples = sorted(data.entries.items())

    d = dict(tuples)

    d = adapt_doi_urls(d, args.doi_url_type)

    tools.write(d, args.outfile, args.delimeter_type, tab_indent=args.tab_indent)