Package: rfcbibtex
RFC BibTexA command line tool that createsBibTexentries for IETFRFCs andInternet Drafts.
It can read the list ofRFCs andInternet Draftsto parse from various sources:directly from.texfilesdirectly from.auxfilesfrom a text file (one ID per line)from command-line argumentsDuplicate entires are filtered out.Installation/RequirementsYou can usepipto install this command-line tool:pip install rfcbibtexorpipenv:pipenv install rfcbibtexAlternatively, you can clone this repository or download therfc-bibtex.py. This tool has no
external dependencies, so as long as you havePython 3.xinstalled, everything
should work fine.Requirements:Python 3.xInternet connectionTestingFirst, install the test dependencies:pipenv install --devorpip install -r dev-requirements.txtand then run:python -m unittest discover testsfrom the project root.UsageThis tool automates the requests to thehttps://datatracker.ietf.org/doc/<id>/<version>/bibtex/andhttps://datatracker.ietf.org/doc/<id>/bibtex/endpoints.usage: rfcbibtex [-h] [-f FILE_NAME] [-o FILE_NAME]
                [inline_args [inline_args ...]]

Generate BibTex entries for IETF RFCs and Internet Drafts. The list of IDs can
be read from a file (including .tex and .aux) or directly from command-line
arguments.

positional arguments:
inline_args           list of RFC and/or Internet Draft IDs, in any order.

optional arguments:
-h, --help            show this help message and exit
-f FILE_NAME, --file FILE_NAME
                        read list of RFC and/or Internet Draft IDs from a
                        file. Supported file formats are the following: .tex,
                        .aux and .txt (one ID per line). If a file with any
                        other extension is provided, the tool attempts to read
                        it as a .txt file, containing one ID per line.
-o FILE_NAME, --output FILE_NAME
                        output the resulting BibTex to a fileIdentifier FormatThe identifier format of RFCs isrfc<rfc_num>, where<rfc_num>is the RFC number.
For example, for theRFC specifying TLS 1.2you
would writerfc5246(NOTE: the identifiers are case-insensitive, soRFC5246andrFc5246are also accepted).The input format of Internet-Drafts(I-Ds) isdraft-<rest>, where<rest>is the rest of
the draft's name (all Internet-Drafts begin with "draft"). For example, for theTLS 1.3 Draft 21you would writedraft-ietf-tls-tls13-21.Read Inputs From Command LineExample command:rfcbibtex RFC5246 draft-ietf-tls-tls13-21Output:@misc{rfc5246,
        series =        {Request for Comments},
        number =        5246,
        howpublished =  {RFC 5246},
        publisher =     {RFC Editor},
        doi =           {10.17487/RFC5246},
        url =           {https://rfc-editor.org/rfc/rfc5246.txt},
        author =        {Eric Rescorla and Tim Dierks},
        title =         {{The Transport Layer Security (TLS) Protocol Version 1.2}},
        pagetotal =     104,
        year =          2008,
        month =         aug,
        abstract =      {This document specifies Version 1.2 of the Transport Layer Security (TLS) protocol. The TLS protocol provides communications security over the Internet. The protocol allows client/server applications to communicate in a way that is designed to prevent eavesdropping, tampering, or message forgery. {[}STANDARDS-TRACK{]}},
}

@techreport{draft-ietf-tls-tls13-21,
        number =        {draft-ietf-tls-tls13-21},
        type =          {Internet-Draft},
        institution =   {Internet Engineering Task Force},
        publisher =     {Internet Engineering Task Force},
        note =          {Work in Progress},
        url =           {https://datatracker.ietf.org/doc/html/draft-ietf-tls-tls13-21},
        author =        {Eric Rescorla},
        title =         {{The Transport Layer Security (TLS) Protocol Version 1.3}},
        pagetotal =     143,
        year =          ,
        month =         ,
        day =           ,
        abstract =      {This document specifies version 1.3 of the Transport Layer Security (TLS) protocol. TLS allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery.},
}Read Identifiers From A fileOption:-f <file_name_1> ... <file_name_N>Alternatively, identifiers can be specified in a file.  The following input formats are accepted:.tex: if you specify an.texfile, the program will search for \cite{} commands in the file and
extract those that appear to contain RFCs or Internet Drafts identifiers..aux: if you specify an.auxfile, the program will search for \citation{} commands in the file
and extract those that appear to contain RFCs or Internet Drafts identifiers..txt: the program defaults to this file type if the file's extension is neither.tex, nor.aux.
This file type must contain a list of RFCs or Internet Drafts identifiers, one per line.Please note that the identifiers must be in the format specified in theIdentifier Formatseciton.Reading Identifiers From A .tex FileConsider that you have a file calledrfcs_and_ids.texwith the following content:\documentclass{article}
\usepackage[utf8]{inputenc}

\title{This Is A Simple Tex File For The RFCBibtex Project Demo}
\author{Illya Gerasymchuk}
\date{March 2019}

\usepackage{natbib}
\usepackage{graphicx}

\begin{document}

\maketitle

\section{Introduction}

There is nothing special here, nothing fancy, just a document with a few citations, like
\cite{RFC5246} this one. This one here \cite{the-documentary-2005} should not be parsed.
While this one \cite{draft-ietf-tls-tls13-21} should. And finally, let's cite the
TLS 1.3 RFC \cite{RFC8446}. Well, that's it folks. At least for now... This is a very basic
file, just to test if \textbf{the basic} latex parsing is working.

You can find the RFCBitex project here: https://github.com/iluxonchik/rfc-bibtex

\begin{figure}[h!]
\centering
\includegraphics[scale=1.7]{universe}
\caption{The Universe}
\label{fig:universe}
\end{figure}

\section{Conclusion}

As you can see, your .tex file may have various citations, but only the ones that are RFCs
and/or Internet Draft IDs are parsed.

\bibliographystyle{plain}
\bibliography{references}
\end{document}If you run:rfcbibtex -f rfcs_and_ids.texYou will get the following output:@misc{rfc5246,
        series =        {Request for Comments},
        number =        5246,
        howpublished =  {RFC 5246},
        publisher =     {RFC Editor},
        doi =           {10.17487/RFC5246},
        url =           {https://rfc-editor.org/rfc/rfc5246.txt},
        author =        {Eric Rescorla and Tim Dierks},
        title =         {{The Transport Layer Security (TLS) Protocol Version 1.2}},
        pagetotal =     104,
        year =          2008,
        month =         aug,
        abstract =      {This document specifies Version 1.2 of the Transport Layer Security (TLS) protocol. The TLS protocol provides communications security over the Internet. The protocol allows client/server applications to communicate in a way that is designed to prevent eavesdropping, tampering, or message forgery. {[}STANDARDS-TRACK{]}},
}

@techreport{draft-ietf-tls-tls13-21,
        number =        {draft-ietf-tls-tls13-21},
        type =          {Internet-Draft},
        institution =   {Internet Engineering Task Force},
        publisher =     {Internet Engineering Task Force},
        note =          {Work in Progress},
        url =           {https://datatracker.ietf.org/doc/html/draft-ietf-tls-tls13-21},
        author =        {Eric Rescorla},
        title =         {{The Transport Layer Security (TLS) Protocol Version 1.3}},
        pagetotal =     143,
        year =          ,
        month =         ,
        day =           ,
        abstract =      {This document specifies version 1.3 of the Transport Layer Security (TLS) protocol. TLS allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery.},
}

@misc{rfc8446,
        series =        {Request for Comments},
        number =        8446,
        howpublished =  {RFC 8446},
        publisher =     {RFC Editor},
        doi =           {10.17487/RFC8446},
        url =           {https://rfc-editor.org/rfc/rfc8446.txt},
        author =        {Eric Rescorla},
        title =         {{The Transport Layer Security (TLS) Protocol Version 1.3}},
        pagetotal =     160,
        year =          2018,
        month =         aug,
        abstract =      {This document specifies version 1.3 of the Transport Layer Security (TLS) protocol. TLS allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery. This document updates RFCs 5705 and 6066, and obsoletes RFCs 5077, 5246, and 6961. This document also specifies new requirements for TLS 1.2 implementations.},
}Reading Identifiers From a .aux FileConsider that you have a file calledrfcs_and_ids.auxwith the following content:\relax
\citation{RFC5246}
\citation{the-documentary-2005}
\citation{draft-ietf-tls-tls13-21}
\citation{RFC8446}
\bibstyle{plain}
\bibdata{references}
\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{1}}
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces The Universe}}{1}}
\newlabel{fig:universe}{{1}{1}}
\@writefile{toc}{\contentsline {section}{\numberline {2}Conclusion}{1}}If you run:rfcbibtex -f rfcs_and_ids.auxYou will get thesame output as in the previous section.Reading Identifiers From a .txt FileConsider that you have a file calledrfcs_and_ids.txtwith the following content:RFC5246
the-documentary-2005
draft-ietf-tls-tls13-21
RFC8446If you run:rfcbibtex -f rfcs_and_ids.auxYou will get thesame output as in the previous section.Combining Multiple FilesYou can also combine multiple files with different types. You can even combine files and command line arguments.Let's assume you have a file calledrfcs.txtwith the following content:RFC5246
rFc7231We will also use therfcs_and_ids.tex from a previous example. If you run:rfcbibtex rfc1234 -f rfcs.txt rfcs_and_ids.texYou will get the following output:@misc{rfc7231,
        series =        {Request for Comments},
        number =        7231,
        howpublished =  {RFC 7231},
        publisher =     {RFC Editor},
        doi =           {10.17487/RFC7231},
        url =           {https://rfc-editor.org/rfc/rfc7231.txt},
        author =        {Roy T. Fielding and Julian Reschke},
        title =         {{Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content}},
        pagetotal =     101,
        year =          2014,
        month =         jun,
        abstract =      {The Hypertext Transfer Protocol (HTTP) is a stateless \textbackslash{}\%application- level protocol for distributed, collaborative, hypertext information systems. This document defines the semantics of HTTP/1.1 messages, as expressed by request methods, request header fields, response status codes, and response header fields, along with the payload of messages (metadata and body content) and mechanisms for content negotiation.},
}

@techreport{draft-ietf-tls-tls13-21,
        number =        {draft-ietf-tls-tls13-21},
        type =          {Internet-Draft},
        institution =   {Internet Engineering Task Force},
        publisher =     {Internet Engineering Task Force},
        note =          {Work in Progress},
        url =           {https://datatracker.ietf.org/doc/html/draft-ietf-tls-tls13-21},
        author =        {Eric Rescorla},
        title =         {{The Transport Layer Security (TLS) Protocol Version 1.3}},
        pagetotal =     143,
        year =          ,
        month =         ,
        day =           ,
        abstract =      {This document specifies version 1.3 of the Transport Layer Security (TLS) protocol. TLS allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery.},
}

@misc{rfc1234,
        series =        {Request for Comments},
        number =        1234,
        howpublished =  {RFC 1234},
        publisher =     {RFC Editor},
        doi =           {10.17487/RFC1234},
        url =           {https://rfc-editor.org/rfc/rfc1234.txt},
        author =        {Don Provan},
        title =         {{Tunneling IPX traffic through IP networks}},
        pagetotal =     6,
        year =          1991,
        month =         jun,
        abstract =      {This memo describes a method of encapsulating IPX datagrams within UDP packets so that IPX traffic can travel across an IP internet. {[}STANDARDS-TRACK{]} This memo defines objects for managing DS1 Interface objects for use with the SNMP protocol. {[}STANDARDS-TRACK{]}},
}

@misc{rfc5246,
        series =        {Request for Comments},
        number =        5246,
        howpublished =  {RFC 5246},
        publisher =     {RFC Editor},
        doi =           {10.17487/RFC5246},
        url =           {https://rfc-editor.org/rfc/rfc5246.txt},
        author =        {Eric Rescorla and Tim Dierks},
        title =         {{The Transport Layer Security (TLS) Protocol Version 1.2}},
        pagetotal =     104,
        year =          2008,
        month =         aug,
        abstract =      {This document specifies Version 1.2 of the Transport Layer Security (TLS) protocol. The TLS protocol provides communications security over the Internet. The protocol allows client/server applications to communicate in a way that is designed to prevent eavesdropping, tampering, or message forgery. {[}STANDARDS-TRACK{]}},
}

@misc{rfc8446,
        series =        {Request for Comments},
        number =        8446,
        howpublished =  {RFC 8446},
        publisher =     {RFC Editor},
        doi =           {10.17487/RFC8446},
        url =           {https://rfc-editor.org/rfc/rfc8446.txt},
        author =        {Eric Rescorla},
        title =         {{The Transport Layer Security (TLS) Protocol Version 1.3}},
        pagetotal =     160,
        year =          2018,
        month =         aug,
        abstract =      {This document specifies version 1.3 of the Transport Layer Security (TLS) protocol. TLS allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery. This document updates RFCs 5705 and 6066, and obsoletes RFCs 5077, 5246, and 6961. This document also specifies new requirements for TLS 1.2 implementations.},
}Note thatduplicateentries have been removed.Output Contents To A FileOption:-o <file_name>Consideringrfcs.txtandrfcs_and_ids.texfrom the above above.If you run:rfcbibtex rfc1234 -f rfcs.txt rfcs_and_ids.tex -o output.bibA fileoutput.bibwould be createdor overriddenwith thethe same content as in the above output.Error Handling and WarningThe tool will print a warning in the following cases:no explicit version defined for a draft iddrafts which have a new draft version updatedrafts which have been assigned anRFCnumberinvalid identifier name provided as acommand-line argument(invalid identifier names from files are simply not parsed)errors in fetching from URLsIt's important to note, that such errorsDO NOT break the correct functionality of the tool. Those errors and warnings are printed out,
butIGNORED. The generated BibTex files are valid, even when errors are found. Errors and warnings are only printed on the console
(into the standard error output stream) andnever to the output files(-ooption).Here is an example of an output of errors and warnings: