Reference#
rfc_lookup.command#
Command-line interface.
- rfc_lookup.command.main()#
Main entry point for the CLI.
- Return type:
None
rfc_lookup.constants#
Constants for the rfc_lookup package.
rfc_lookup.errors#
Exceptions for the rfc_lookup package.
- exception rfc_lookup.errors.InvalidRfcIdError#
Raised when an invalid RFC ID is provided.
- exception rfc_lookup.errors.NetworkError#
Raised when a network request fails.
rfc_lookup.utilities#
Module for package utility functions.
- rfc_lookup.utilities.clean_chars(text)#
Clean up special characters in a string.
- Parameters:
text (str) – The input string to clean.
- Returns:
The cleaned string with non-breaking spaces replaced.
- Return type:
str
- rfc_lookup.utilities.extract_authors(line)#
Split a line of author data into individual authors.
Keeps ‘Ed.’ attached to the corresponding name.
- Parameters:
line (str) – A single line of author data.
- Returns:
A list of individual authors.
- Return type:
list
- rfc_lookup.utilities.get_latest_report_ids()#
Get and parse the IETF latest reports.
- Returns:
A sorted list of known RFC IDs as integers.
- Return type:
list
- rfc_lookup.utilities.get_request(url, params=None)#
Get the content of a web page.
- Parameters:
url (str) – The URL to request.
params (dict, optional) – Query parameters to append to the URL.
- Returns:
The raw response body.
- Return type:
bytes
- Raises:
ValueError – If the URL is empty or uses a disallowed scheme.
NetworkError – If the request fails due to a network or HTTP error.
- rfc_lookup.utilities.get_rfc_report(report_id)#
Get the RFC report for a given RFC ID.
- Parameters:
report_id (int) – The RFC number to retrieve.
- Returns:
The plain-text content of the RFC document.
- Return type:
str
- Raises:
InvalidRfcIdError – If report_id is out of the valid range.
- rfc_lookup.utilities.search_rfc_editor(value)#
Search the RFC editor for RFCs by title.
- Parameters:
value (str) – The title or keyword to search for.
- Returns:
- A list of dicts, each representing a matching RFC with keys:
id, link, files, title, authors, publication_date, more_info, status.
- Return type:
list