Home / File/ doc_parsing_utils.py — fastapi Source File

doc_parsing_utils.py — fastapi Source File

Architecture documentation for doc_parsing_utils.py, a python file in the fastapi codebase. 2 imports, 2 dependents.

File python FastAPI Responses 2 imports 2 dependents 20 functions 6 classes

Entity Profile

Dependency Diagram

graph LR
  c463d6a9_085f_f272_b9fc_455b7e9b6a57["doc_parsing_utils.py"]
  b423f231_0305_b686_5fea_7c66fe42f25b["re"]
  c463d6a9_085f_f272_b9fc_455b7e9b6a57 --> b423f231_0305_b686_5fea_7c66fe42f25b
  0dda2280_3359_8460_301c_e98c77e78185["typing"]
  c463d6a9_085f_f272_b9fc_455b7e9b6a57 --> 0dda2280_3359_8460_301c_e98c77e78185
  6dda5e35_b655_8af3_cd89_8c1584a092c4["translate.py"]
  6dda5e35_b655_8af3_cd89_8c1584a092c4 --> c463d6a9_085f_f272_b9fc_455b7e9b6a57
  99e3c039_dae8_2ebf_8149_637bcc119c08["translation_fixer.py"]
  99e3c039_dae8_2ebf_8149_637bcc119c08 --> c463d6a9_085f_f272_b9fc_455b7e9b6a57
  style c463d6a9_085f_f272_b9fc_455b7e9b6a57 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import re
from typing import TypedDict, Union

CODE_INCLUDE_RE = re.compile(r"^\{\*\s*(\S+)\s*(.*)\*\}$")
CODE_INCLUDE_PLACEHOLDER = "<CODE_INCLUDE>"

HEADER_WITH_PERMALINK_RE = re.compile(r"^(#{1,6}) (.+?)(\s*\{\s*#.*\s*\})?\s*$")
HEADER_LINE_RE = re.compile(r"^(#{1,6}) (.+?)(?:\s*\{\s*(#.*)\s*\})?\s*$")

TIANGOLO_COM = "https://fastapi.tiangolo.com"
ASSETS_URL_PREFIXES = ("/img/", "/css/", "/js/")

MARKDOWN_LINK_RE = re.compile(
    r"(?<!\\)(?<!\!)"  # not an image ![...] and not escaped \[...]
    r"\[(?P<text>.*?)\]"  # link text (non-greedy)
    r"\("
    r"(?P<url>[^)\s]+)"  # url (no spaces and `)`)
    r'(?:\s+["\'](?P<title>.*?)["\'])?'  # optional title in "" or ''
    r"\)"
    r"(?:\s*\{(?P<attrs>[^}]*)\})?"  # optional attributes in {}
)

HTML_LINK_RE = re.compile(r"<a\s+[^>]*>.*?</a>")
HTML_LINK_TEXT_RE = re.compile(r"<a\b([^>]*)>(.*?)</a>")
HTML_LINK_OPEN_TAG_RE = re.compile(r"<a\b([^>]*)>")
HTML_ATTR_RE = re.compile(r'(\w+)\s*=\s*([\'"])(.*?)\2')

CODE_BLOCK_LANG_RE = re.compile(r"^`{3,4}([\w-]*)", re.MULTILINE)

SLASHES_COMMENT_RE = re.compile(
    r"^(?P<code>.*?)(?P<comment>(?:(?<= )// .*)|(?:^// .*))?$"
)

HASH_COMMENT_RE = re.compile(r"^(?P<code>.*?)(?P<comment>(?:(?<= )# .*)|(?:^# .*))?$")


class CodeIncludeInfo(TypedDict):
    line_no: int
    line: str


class HeaderPermalinkInfo(TypedDict):
    line_no: int
    hashes: str
    title: str
    permalink: str


class MarkdownLinkInfo(TypedDict):
    line_no: int
    url: str
    text: str
    title: Union[str, None]
    attributes: Union[str, None]
    full_match: str


class HTMLLinkAttribute(TypedDict):
    name: str
    quote: str
// ... (674 more lines)

Domain

Subdomains

Dependencies

  • re
  • typing

Frequently Asked Questions

What does doc_parsing_utils.py do?
doc_parsing_utils.py is a source file in the fastapi codebase, written in python. It belongs to the FastAPI domain, Responses subdomain.
What functions are defined in doc_parsing_utils.py?
doc_parsing_utils.py defines 20 function(s): _add_lang_code_to_url, _construct_html_link, _construct_markdown_link, _split_hash_comment, _split_slashes_comment, check_translation, extract_code_includes, extract_header_permalinks, extract_html_links, extract_markdown_links, and 10 more.
What does doc_parsing_utils.py depend on?
doc_parsing_utils.py imports 2 module(s): re, typing.
What files import doc_parsing_utils.py?
doc_parsing_utils.py is imported by 2 file(s): translate.py, translation_fixer.py.
Where is doc_parsing_utils.py in the architecture?
doc_parsing_utils.py is located at scripts/doc_parsing_utils.py (domain: FastAPI, subdomain: Responses, directory: scripts).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free