Skip to main content

xml2rfc generates RFCs and IETF drafts from document source in XML according to the IETF xml2rfc v2 and v3 vocabularies.

Project description

XML2RFC

Release License PyPI - Version PyPI - Status PyPI - Format

Generate RFCs and IETF drafts from document source in XML according to the IETF xml2rfc v2 and v3 vocabularies

Introduction

The IETF uses a specific format for the standards and other documents it publishes as RFCs, and for the draft documents which are produced when developing documents for publications. There exists a number of different tools to facilitate the formatting of drafts and RFCs according to the existing rules, and this tool, xml2rfc, is one of them. It takes as input an xml file that contains the text and meta-information about author names etc., and transforms it into suitably formatted output. The input xml file should follow the grammars in RFC7749 (for v2 documents) or RFC7991 (for v3 documents). Note that the grammar for v3 is still being refined, and changes will eventually be captured in the bis draft for 7991. Changes not yet captured can be seen in the xml2rfc source v3.rng, or in the documentation xml2rfc produces with its --doc flag.

xml2rfc provides a variety of output formats. See the command line help for a full list of formats. It also provides conversion from v2 to v3, and can run the preptool on its input.

Installation

xml2rfc is available as Python package. You can install it with following command:

pip install xml2rfc

If you're using pipx, you can install xml2rfc with the following command:

pipx install xml2rfc

xml2rfc also provides pdf extra package to install required packages required for PDF file generation. See next section about additional requirements for PDF generation.

To install xml2rfc with PDF generation support run:

pip install "xml2rfc[pdf]"

To install pdf extra with pipx run:

pipx install "xml2rfc[pdf]"

Installation of support libraries for the PDF-formatter

In order to generate PDFs, xml2rfc uses the WeasyPrint module, which depends on external libraries that must be installed as native packages on your platform, separately from the xml2rfc install.

  1. First, install the Pango, and other required libraries on your system. See installation instructions on the WeasyPrint Docs.

  2. Next, install WeasyPrint python modules using pip.

pip install "xml2rfc[pdf]"
  1. Finally, install the required fonts:
  • Download latest fonts from xml2rfc-fonts.
  • In the Assets section, download either the tar.gz or the zip archive.
  • Extract the contents of the downloaded xml2rfc-fonts archive.
  • Install the fonts found in the noto and roboto_mono directories to your operating system.

With these installed and available to xml2rfc, the --pdf switch will be enabled.

Updating xml2rfc

To update xml2rfc, run the following command:

pip install --upgrade xml2rfc

If you are using pipx, you can update it with:

pipx upgrade xml2rfc

Usage

xml2rfc accepts a single XML document as input and outputs to one or more conversion formats.

Basic Usage

xml2rfc SOURCE [options] FORMATS...

Run xml2rfc --help for a full listing of command-line options.

Getting Started

This project is following the standard Git Feature Workflow development model. Learn about all the various steps of the development workflow, from creating a fork to submitting a pull request, in the Contributing guide.

Make sure to read the Styleguides section to ensure a cohesive code format across the project.

You can submit bug reports, enhancements and new feature requests in the discussions area. Accepted tickets will be converted to issues.

Git Cloning Tips

As outlined in the Contributing guide, you will first want to create a fork of the xml2rfc project in your personal GitHub account before cloning it.

For example (replace USERNAME with your GitHub username):

git clone https://github.com/USERNAME/xml2rfc.git

Docker Dev Environment

Run ./run.sh command to build and start a docker development environment. The initial build may take time because it downloads all required fonts as well.

./run.sh

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xml2rfc-3.29.0.tar.gz (421.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xml2rfc-3.29.0-py3-none-any.whl (376.6 kB view details)

Uploaded Python 3

File details

Details for the file xml2rfc-3.29.0.tar.gz.

File metadata

  • Download URL: xml2rfc-3.29.0.tar.gz
  • Upload date:
  • Size: 421.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for xml2rfc-3.29.0.tar.gz
Algorithm Hash digest
SHA256 82a1806095ea9a83caa9ee6923bf50f7b7686325042e3e023e34984a54c822db
MD5 9c6e177c35d49abe3b2b029746465c2e
BLAKE2b-256 942abbd76ef42f69d07f7d736c113f4bdd050c7a8e7068f0f397d85185912756

See more details on using hashes here.

Provenance

The following attestation bundles were made for xml2rfc-3.29.0.tar.gz:

Publisher: pypi-publish.yml on ietf-tools/xml2rfc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xml2rfc-3.29.0-py3-none-any.whl.

File metadata

  • Download URL: xml2rfc-3.29.0-py3-none-any.whl
  • Upload date:
  • Size: 376.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for xml2rfc-3.29.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1744fb9e147d4653a55b2edfbb93e58c881df2a8f01eecf82755abdc641b52c7
MD5 747539922ca457313e096f83c227d40f
BLAKE2b-256 f7806a2fd202fac4588d9af88b6e118f4c2e76d7a47b0d7c6fcc6d09166dbfde

See more details on using hashes here.

Provenance

The following attestation bundles were made for xml2rfc-3.29.0-py3-none-any.whl:

Publisher: pypi-publish.yml on ietf-tools/xml2rfc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page