How to use the betterbib.crossref.Crossref 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 / sync.py View on Github external
def sync(d, source, long_journal_name, max_workers):
    if source == "crossref":
        source = crossref.Crossref(long_journal_name)
    else:
        assert source == "dblp", "Illegal source."
        source = dblp.Dblp()

    print()

    num_success = 0
    with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
        responses = {
            executor.submit(source.find_unique, entry): (bib_id, tools.decode(entry))
            for bib_id, entry in d.items()
        }
        for future in tqdm(
            concurrent.futures.as_completed(responses), total=len(responses)
        ):
            bib_id, entry = responses[future]
github nschloe / betterbib / betterbib / cli / doi2bibtex.py View on Github external
def main(argv=None):
    parser = _get_parser()
    args = parser.parse_args(argv)
    source = crossref.Crossref()
    entry = source.get_by_doi(args.doi)

    bibtex_key = "key"
    string = tools.pybtex_to_bibtex_string(entry, bibtex_key)
    args.outfile.write(string)
    return