; Python entry-point detection queries
; Captures: @node (entry point), @name (identifier)

; if __name__ == "__main__":
(if_statement
  condition: (comparison_operator
    (identifier) @name
    (#eq? @name "__name__"))) @node

; Flask/FastAPI/Sanic app creation
; app = Flask(__name__) / app = FastAPI()
(assignment
  left: (identifier) @name
  right: (call
    function: (identifier) @_cls
    (#match? @_cls "^(Flask|FastAPI|Sanic|Quart)$"))) @node

; Django urlpatterns
(assignment
  left: (identifier) @name
  (#eq? @name "urlpatterns")) @node
