Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_parser():
parser = argparse.ArgumentParser(
description="Sync BibTeX files with information from online sources."
)
parser.add_argument(
"-v",
"--version",
help="display version information",
action="version",
version="betterbib {}, Python {}".format(__about__.__version__, sys.version),
)
parser.add_argument(
"infile",
nargs="?",
type=argparse.FileType("r"),
default=sys.stdin,
help="input BibTeX file (default: stdin)",
)
parser.add_argument(
"outfile",
nargs="?",
type=argparse.FileType("w"),
default=sys.stdout,
help="output BibTeX file (default: stdout)",
)
parser.add_argument(
def _get_parser():
parser = argparse.ArgumentParser(
description="Sync BibTeX files with information from online sources."
)
parser.add_argument(
"-v",
"--version",
help="display version information",
action="version",
version="betterbib {}, Python {}".format(__about__.__version__, sys.version),
)
parser.add_argument(
"infile",
nargs="?",
type=argparse.FileType("r"),
default=sys.stdin,
help="input BibTeX file (default: stdin)",
)
parser.add_argument(
"outfile",
nargs="?",
type=argparse.FileType("w"),
default=sys.stdout,
help="output BibTeX file (default: stdout)",
)
parser.add_argument(
def _get_version_text():
return "\n".join(
[
"betterbib {} [Python {}.{}.{}]".format(
__about__.__version__,
sys.version_info.major,
sys.version_info.minor,
sys.version_info.micro,
),
__about__.__copyright__,
]
def _get_parser():
parser = argparse.ArgumentParser(description="Reformat BibTeX files.")
parser.add_argument(
"-v",
"--version",
help="display version information",
action="version",
version="betterbib {}, Python {}".format(__about__.__version__, sys.version),
)
parser.add_argument(
"infile",
nargs="?",
type=argparse.FileType("r"),
default=sys.stdin,
help="input BibTeX file (default: stdin)",
)
parser.add_argument(
"outfile",
nargs="?",
type=argparse.FileType("w"),
default=sys.stdout,
help="output BibTeX file (default: stdout)",
)
parser.add_argument(
def _get_parser():
parser = argparse.ArgumentParser(
description="Removes one of DOI and URL in a BibTeX file "
"if both are identical."
)
parser.add_argument(
"-v",
"--version",
help="display version information",
action="version",
version="betterbib {}, Python {}".format(__about__.__version__, sys.version),
)
parser.add_argument(
"infile",
nargs="?",
type=argparse.FileType("r"),
default=sys.stdin,
help="input BibTeX file (default: stdin)",
)
parser.add_argument(
"outfile",
nargs="?",
type=argparse.FileType("w"),
default=sys.stdout,
help="output BibTeX file (default: stdout)",
)
parser.add_argument(
def _write(od, out, delimeter_type):
# Write header to the output file.
out.write(
"%comment{{This file was created with betterbib v{}.}}\n\n".format(
__about__.__version__
)
)
# write the data out sequentially to respect ordering
for bib_id, d in od.items():
brace_delimeters = delimeter_type == "curly"
a = tools.pybtex_to_bibtex_string(d, bib_id, brace_delimeters=brace_delimeters)
out.write(a + "\n\n")
return
def _get_parser():
parser = argparse.ArgumentParser(description="(Un)abbreviate journal names.")
parser.add_argument(
"-v",
"--version",
help="display version information",
action="version",
version="betterbib {}, Python {}".format(__about__.__version__, sys.version),
)
parser.add_argument(
"infile",
nargs="?",
type=argparse.FileType("r"),
default=sys.stdin,
help="input BibTeX file (default: stdin)",
)
parser.add_argument(
"outfile",
nargs="?",
type=argparse.FileType("w"),
default=sys.stdout,
help="output BibTeX file (default: stdout)",
)
parser.add_argument(
def _get_version_text():
return "\n".join(
[
"betterbib {} [Python {}.{}.{}]".format(
__about__.__version__,
sys.version_info.major,
sys.version_info.minor,
sys.version_info.micro,
),
__about__.__copyright__,
]