Visualize relations between RFCs
Go to file
2023-01-03 14:42:54 +01:00
rfcartography Version 1.0.0 2023-01-03 14:42:54 +01:00
tests Version 1.0.0 2023-01-03 14:42:54 +01:00
.gitignore Version 1.0.0 2023-01-03 14:42:54 +01:00
LICENSE Version 1.0.0 2023-01-03 14:42:54 +01:00
README.md Version 1.0.0 2023-01-03 14:42:54 +01:00
requirements.txt Version 1.0.0 2023-01-03 14:42:54 +01:00

RFCartography

Visualize relations between RFCs

Set Up

Clone this repository and install dependencies, e.g. using pip install -r requirements.txt. Place the index file (can be downloaded here) in the instance folder create a configuration in that location (see Configuration).

Afterwards, RFCartography can be run by executing

flask --app rfcartography run

Note: Use flask run only for local development. If you want to deploy it to a production server, use a WSGI server instead, as explained in the Flask documentation.

Hint: Generating large graphs takes a lot of time. It is highly recommended to cache responses to improve response times.

Configuration

RFCartography (or rather Flask, the framework it's based on) searches for the configuration in the instance directory. To configure your instance, create a config.py file in this directory.

Flask Configuration Parameters

  • SERVER_NAME: Set the servers name, e.g. it's URL or address. RFCartography requires this value to be set correctly. If unset, it will default to localhost.

For further generic configuration parameters, please refer to the Flask documentation.

RFCartography Specific Configuration Parameters

  • INDEX_FILE: XML file containing the RFC index, usually downloaded from here
  • NAMESPACE: XML namespace of the RFC index, defaults to http://www.rfc-editor.org/rfc-index
  • DEPTH_DEFAULT: Depth limit to be used for requests w/o specified depth limit, defaults to 8
  • IMPRINT: Content that shall be displayed on the imprint page, see Custom Content for the syntax
  • PRIVACY: Content that shall be displayed on the privacy page, see Custom Content for the syntax

Custom Content

The content of the imprint and the privacy pages can be configured with the config file. The corresponding parameters take a list of tuples of strings. The first item of each tuple will be displayed as a headline, all following items as paragraphs.

Example:

PRIVACY = [('Privacy Statement', 'This website only processes data that is necessary in order to fulfill the user\'s request, e.g. the user\'s IP address. It does not generate access logs. Personal data is discarded once the request was served.')]

Additional line breaks within a paragraph can be inserted by using a tuple of multiple strings instead of a string as a paragraph, e.g.:

IMPRINT = [('E-Mail', 'My mail addresses are', ('example[at]not-a-real-mail-address.net', 'another-example[at]not-a-real-mail-address.net', 'one-more.example[at]not-a-real-mail-address.net'))]

Maintenance

Remember to regularly update the rfc index file.

Tests

Unittests a place in the tests directory. Run all tests by executing:

python -m unittest discover tests

If you have coverage.py installed, you can check the coverage by executing:

python -m coverage run -m unittest discover tests
python -m coverage report