rfcartography | ||
tests | ||
.gitignore | ||
LICENSE | ||
README.md | ||
requirements.txt |
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 tolocalhost
.
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 hereNAMESPACE
: XML namespace of the RFC index, defaults tohttp://www.rfc-editor.org/rfc-index
DEPTH_DEFAULT
: Depth limit to be used for requests w/o specified depth limit, defaults to 8IMPRINT
: Content that shall be displayed on the imprint page, seeCustom Content
for the syntaxPRIVACY
: Content that shall be displayed on the privacy page, seeCustom 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